Skip to content

Commit

Permalink
fix(keyboard-navigation): remove references to blockly.fieldcolour
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishesh-Paliwal committed Aug 7, 2024
1 parent 0eb13cd commit 08d1490
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions plugins/keyboard-navigation/src/navigation_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ export class NavigationController {
* @protected
*/
addShortcutHandlers() {
if (Blockly.FieldColour) {
Blockly.FieldColour.prototype.onShortcut = this.fieldColourHandler;
}

if (Blockly.FieldDropdown) {
Blockly.FieldDropdown.prototype.onShortcut = this.fieldDropdownHandler;
}
Expand All @@ -77,10 +73,6 @@ export class NavigationController {
* @protected
*/
removeShortcutHandlers() {
if (Blockly.FieldColour) {
Blockly.FieldColour.prototype.onShortcut = null;
}

if (Blockly.FieldDropdown) {
Blockly.FieldDropdown.prototype.onShortcut = null;
}
Expand All @@ -90,40 +82,6 @@ export class NavigationController {
}
}

/**
* Handles the given keyboard shortcut.
* This is only triggered when keyboard accessibility mode is enabled.
* @param {!Blockly.ShortcutRegistry.KeyboardShortcut} shortcut The shortcut
* to be handled.
* @returns {boolean} True if the field handled the shortcut,
* false otherwise.
* @this {Blockly.FieldColour}
* @protected
*/
fieldColourHandler(shortcut) {
if (this.picker_) {
switch (shortcut.name) {
case Constants.SHORTCUT_NAMES.PREVIOUS:
this.moveHighlightBy_(0, -1);
return true;
case Constants.SHORTCUT_NAMES.NEXT:
this.moveHighlightBy_(0, 1);
return true;
case Constants.SHORTCUT_NAMES.OUT:
this.moveHighlightBy_(-1, 0);
return true;
case Constants.SHORTCUT_NAMES.IN:
this.moveHighlightBy_(1, 0);
return true;
default:
return false;
}
}
// If we haven't already handled the shortcut, let the default Field
// handler try.
return Blockly.Field.prototype.onShortcut.call(this, shortcut);
}

/**
* Handles the given keyboard shortcut.
* This is only triggered when keyboard accessibility mode is enabled.
Expand Down

0 comments on commit 08d1490

Please sign in to comment.