matrix: if scroll is true, children's values no longer feed the matrix' value and onValue script, it will be used for scrolling state, like with panels

This commit is contained in:
jean-emmanuel 2025-09-19 10:33:38 +02:00
parent de9b5db120
commit 714bdddb96
3 changed files with 14 additions and 14 deletions

View file

@ -10,7 +10,7 @@
- input/textarea/select no longer have their appearance property reset in custom html
- canvas: added `contextType` property
- file: honor server's `remote-root` option (remove root path from displayed path and returned value)
- matrix: if `scroll` is `true`, children's values no longer feed the matrix' value and onValue script, it will be used for scrolling state, like with panels
- scripting
- user scripts are longer protected against infinite loop and the main window object may be reached (it's not supported to break out of scripting context, but resources are no longer wasted to prevent it)

View file

@ -45,24 +45,24 @@ class Matrix extends Panel {
this.resolveLock = false
this.on('value-changed',(e)=>{
if (!this.getProp('scroll')) {
this.on('value-changed',(e)=>{
if (e.widget === this) return
if (e.widget === this) return
var widget = this.getProp('widgetType') === 'clone' ? e.widget.parent : e.widget
var widget = this.getProp('widgetType') === 'clone' ? e.widget.parent : e.widget
if (widget.parent !== this) return
if (widget.parent !== this) return
this.value[widget._index] = e.widget.getValue()
this.value[widget._index] = e.widget.getValue()
this.changed({
...e.options,
id: widget.getProp('id')
})
this.changed({
...e.options,
id: widget.getProp('id')
})
})
}
if (parser.widgets[this.getProp('widgetType')]) {

View file

@ -274,7 +274,7 @@ class Panel extends Container() {
if (options.send) this.sendValue()
if (options.sync) this.changed(options)
} else if (this.childrenType === 'widget' && Array.isArray(v) && v.length === 2 && this.props.type !== 'modal') {
} else if (this.getProp('scroll') && this.childrenType !== 'tab' && Array.isArray(v) && v.length === 2 && this.props.type !== 'modal') {
this.value = v
clearTimeout(this.scrollTimeout)