Skip to content

Commit

Permalink
Backport PR #16335: Reactive toolbar: avoid simultaneous calls to _on…
Browse files Browse the repository at this point in the history
…Resize() (#16338)

Co-authored-by: Nicolas Brichet <32258950+brichet@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and brichet committed May 19, 2024
1 parent 75cc8fe commit 67dc91b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-components/src/components/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,8 @@ export class ReactiveToolbar extends Toolbar<Widget> {
const toolbarPadding = 2 + 5;
let width = opener.isHidden ? toolbarPadding : toolbarPadding + openerWidth;

this._getWidgetsToRemove(width, toolbarWidth, openerWidth)
.then(values => {
return this._getWidgetsToRemove(width, toolbarWidth, openerWidth)
.then(async values => {
let { width, widgetsToRemove } = values;
while (widgetsToRemove.length > 0) {
// Insert the widget at the right position in the opener popup, relatively
Expand Down Expand Up @@ -626,7 +626,7 @@ export class ReactiveToolbar extends Toolbar<Widget> {
opener.hide();
}
if (callTwice) {
void this._onResize();
await this._onResize();
}
})
.catch(msg => {
Expand Down

0 comments on commit 67dc91b

Please sign in to comment.