scrollbar: fix init state when recreating panel
This commit is contained in:
parent
9c5ad33944
commit
edca21bb99
1 changed files with 7 additions and 2 deletions
|
|
@ -155,8 +155,13 @@ export default class Scrollbar extends StaticProperties(Fader, {
|
|||
|
||||
this.thumbSize = this.scrollTarget.scrollThumb[index]
|
||||
this.cssVars.knobSize = Math.max(this.thumbSize * size, 30)
|
||||
if (this.scrollTarget.scroll[index] != this.value) {
|
||||
this.setValue(this.scrollTarget.scroll[index], {fromScrollEvent:true, send:!init, sync:!init})
|
||||
|
||||
if (init && this.value) {
|
||||
// panel (re)createed: restore scroll state
|
||||
this.setValue(this.value, {fromScrollEvent: false, send: false, sync: false})
|
||||
} else if (this.scrollTarget.scroll[index] != this.value) {
|
||||
// panel scrolling: update scroll state
|
||||
this.setValue(this.scrollTarget.scroll[index], {fromScrollEvent: true, send: !init, sync: !init})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue