-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support keyboard navigation of flyout buttons #2200
feat: support keyboard navigation of flyout buttons #2200
Conversation
@NeilFraser Will you be able to review this PR this week? The tests fail because this PR depends on changes in core. I think this PR needs to be against the v11 branch, and then when the core PR is merged and eventually lands in a beta release, they should {theoretically} pass. Once this PR is reviewed I can facilitate that process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The linting errors are ignorable in my opinion.
The lint errors are not ignorable since they cause lint to fail and are easily fixed. |
OK, the latest beta of Blockly has been published which contains your changes from core! So next steps:
Later, after we release v11 (the next release of Blockly, coming... soon) then our team will take everything in the rc/v11.0.0 branch of samples and update them to rely on the real version not the beta, test the plugins, and release them all. Thanks for your patience & willingness to contribute despite the complicated process with two repos! We're making some changes soon that should streamline a lot of this extra process. |
The basics
The details
Requires:
(Tests will continue to fail as this requires a new
flyout.getContents()
method, defined in the above PR.)Resolves
Makes it possible to support keyboard navigation of flyout buttons, which is listed as a limitation in the documentation:
https://developers.google.com/blockly/guides/configure/web/keyboard-nav
Fixes
Proposed Changes
-modify navigation_controller to trigger button callbacks when pressing "mark" (enter key)
Requires button-type AST Nodes and
flyout.getContents()
, which are proposed here: google/blockly#7852Reason for Changes
These changes will make it possible for users to interact with flyout buttons using keyboard navigation. They also ensure that the top flyout item is selected when focusing a flyout, whether that be a block (stack) or a button. Code.org specifically needs this functionality for variables as well its modal editor for functions and behaviors.
The changes described above are working locally. The following screen recording demonstrates some simple flyout navigation including using various buttons. Note that the keyboard monitoring in the middle of the workspace is a separate application and just used here for illustration purposes.
https://github.com/google/blockly/assets/43474485/899bf8e3-5a76-4c5c-8e3a-3645e42de323
Test Coverage
I have updated the plugin test toolbox to include more buttons as well as nested categories in order to easily test some edge cases. No new tests have been created.
Documentation
The following sections would need to be updated:
Inserting A Block From The Toolbox
Limitations
Additional Information