Skip to content

fix: Don't close the flyout when creating a variable using keyboard nav#9745

Merged
gonfunko merged 5 commits intov13from
closeout
Apr 22, 2026
Merged

fix: Don't close the flyout when creating a variable using keyboard nav#9745
gonfunko merged 5 commits intov13from
closeout

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9122

Proposed Changes

This PR updates Blockly's dialog utility to use a <dialog> element instead of the built-in browser alert modals. This allows for more consistent focus management, since the dialog is just part of the DOM rather than an application-level modal. Secondarily, it adds an event listener to the flyout workspace in the create variable button callback handler that identifies and focuses the newly-created variable block for convenience now that the flyout no longer closes.

@gonfunko gonfunko requested a review from a team as a code owner April 21, 2026 21:06
@gonfunko gonfunko requested a review from maribethb April 21, 2026 21:06
@github-actions github-actions Bot added the PR: fix Fixes a bug label Apr 21, 2026
Copy link
Copy Markdown
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 question about ephemeral focus, and then also want to double check there's no behavioral change for developers who are calling our prompt functions right? so this isn't breaking?

Comment thread packages/blockly/core/dialog.ts
Comment thread packages/blockly/core/dialog.ts
@gonfunko
Copy link
Copy Markdown
Contributor Author

Correct, there should be no functional behavior difference - same API calls work, the contents are just displayed in our custom dialog vs the browser modal. And it's still possible for developers to replace our implementation with their own.

Comment thread packages/blockly/core/dialog.ts
@gonfunko gonfunko merged commit f899f68 into v13 Apr 22, 2026
4 checks passed
@gonfunko
Copy link
Copy Markdown
Contributor Author

This also fixed #9106.

@gonfunko gonfunko deleted the closeout branch April 23, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants