Skip to content

Commit

Permalink
fix(ui-dialog): menu closes when clicking on submenu
Browse files Browse the repository at this point in the history
  • Loading branch information
balzss committed Apr 9, 2024
1 parent 4645981 commit 7e7d1aa
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/ui-dialog/src/Dialog/index.tsx
Expand Up @@ -106,9 +106,13 @@ class Dialog extends Component<DialogProps> {
}

close() {
if (this._focusRegion) {
FocusRegionManager.blurRegion(this.contentElement, this._focusRegion.id)
}
const { _focusRegion, contentElement } = this
// setTimeout is used here to delay the blur after the mousedown event in FocusRegion for correct execution order
setTimeout(() => {
if (_focusRegion) {
FocusRegionManager.blurRegion(contentElement, _focusRegion.id)
}
}, 0)
}

focus() {
Expand Down

0 comments on commit 7e7d1aa

Please sign in to comment.