-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Remove navigation #4593
Remove navigation #4593
Conversation
core/toolbox/toolbox.js
Outdated
* @type {function(!Blockly.ShortcutRegistry.KeyboardShortcut):boolean} | ||
* @public | ||
*/ | ||
Blockly.Toolbox.prototype.onShortcut; |
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.
Since onShortcut
isn't implemented, doesn't that mean that this class isn't properly implementing the IKeyboardAccessible
interface?
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.
I think you are correct. I added a function that returns false. This mirrors what I do with Blockly.Field.
@@ -27,7 +25,6 @@ goog.requireType('Blockly.ShortcutRegistry'); | |||
* A cursor controls how a user navigates the Blockly AST. | |||
* @constructor | |||
* @extends {Blockly.Marker} | |||
* @implements {Blockly.IBlocklyActionable} |
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.
Is it correct that this class isn't going to implement IKeyboardAccessible
?
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.
Yup, the main reason we had onAction
on the cursor was so someone could easily add a shortcut. The shortcut registry makes this easy without onAction
being necessary.
|
||
/** | ||
* Handles the given action. | ||
* @param {!Blockly.ShortcutRegistry.KeyboardShortcut} action The action to be handled. | ||
* @return {boolean} True if the action has been handled, false otherwise. | ||
*/ | ||
Blockly.IBlocklyActionable.prototype.onBlocklyAction; | ||
Blockly.IKeyboardAccessible.prototype.onShortcut; |
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.
It's not clear to me why this was renamed to onShortcut
.
Related, it might help to reword the JSDoc since it's not longer called on action.
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.
The keyboard shortcut registry replaced the idea of Blockly.Actions, so it makes more sense now to have these handlers be named onShortcut instead of onAction.
Yup, good catch.
The basics
The details
Resolves
Proposed Changes
Removes keyboard navigation from core.
Reason for Changes
We will be offering keyboard navigation as a plugin.
Test Coverage
Tested on:
Documentation
Additional Information