Skip to content

Commit 26b6fad

Browse files
authored
fix: Make dialog handling of ephemeral focus more robust (#10064)
1 parent 993fa90 commit 26b6fad

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/blockly/core/dialog.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ function displayDialog(
251251

252252
let restoreFocus: (() => void) | undefined;
253253
if (activeDialogCount === 0) {
254-
restoreFocus = getFocusManager().takeEphemeralFocus(dialog);
254+
if (getFocusManager().ephemeralFocusTaken()) {
255+
restoreFocus = undefined;
256+
} else {
257+
restoreFocus = getFocusManager().takeEphemeralFocus(dialog);
258+
}
255259
}
256260

257261
activeDialogCount++;

0 commit comments

Comments
 (0)