Skip to content

Commit

Permalink
fix: ensure functional before triggering events in ScrollerImpl.update()
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed Apr 9, 2024
1 parent 4ed35c7 commit 3ca725e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/x6-plugin-scroller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class Scroller
this.setup()
this.startListening()
this.updateClassName()
this.scrollerImpl.init()
this.scrollerImpl.center()
}

Expand Down
8 changes: 4 additions & 4 deletions packages/x6-plugin-scroller/src/scroller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ export class ScrollerImpl extends View<ScrollerImpl.EventArgs> {
Dom.append(this.content, graphContainer)
Dom.appendTo(this.content, this.container)

this.startListening()
this.backgroundManager = new ScrollerImpl.Background(this)
}

init() {
if (!this.options.pageVisible) {
this.graph.grid.update()
}

this.backgroundManager = new ScrollerImpl.Background(this)

if (!this.options.autoResize) {
this.update()
}
this.startListening()
}

protected startListening() {
Expand Down

0 comments on commit 3ca725e

Please sign in to comment.