Skip to content

Commit 81787b7

Browse files
fix(keyboard-navigation): remove references to blockly.fieldcolour (#2441)
1 parent 0eb13cd commit 81787b7

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

plugins/keyboard-navigation/src/navigation_controller.js

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ export class NavigationController {
5858
* @protected
5959
*/
6060
addShortcutHandlers() {
61-
if (Blockly.FieldColour) {
62-
Blockly.FieldColour.prototype.onShortcut = this.fieldColourHandler;
63-
}
64-
6561
if (Blockly.FieldDropdown) {
6662
Blockly.FieldDropdown.prototype.onShortcut = this.fieldDropdownHandler;
6763
}
@@ -77,10 +73,6 @@ export class NavigationController {
7773
* @protected
7874
*/
7975
removeShortcutHandlers() {
80-
if (Blockly.FieldColour) {
81-
Blockly.FieldColour.prototype.onShortcut = null;
82-
}
83-
8476
if (Blockly.FieldDropdown) {
8577
Blockly.FieldDropdown.prototype.onShortcut = null;
8678
}
@@ -90,40 +82,6 @@ export class NavigationController {
9082
}
9183
}
9284

93-
/**
94-
* Handles the given keyboard shortcut.
95-
* This is only triggered when keyboard accessibility mode is enabled.
96-
* @param {!Blockly.ShortcutRegistry.KeyboardShortcut} shortcut The shortcut
97-
* to be handled.
98-
* @returns {boolean} True if the field handled the shortcut,
99-
* false otherwise.
100-
* @this {Blockly.FieldColour}
101-
* @protected
102-
*/
103-
fieldColourHandler(shortcut) {
104-
if (this.picker_) {
105-
switch (shortcut.name) {
106-
case Constants.SHORTCUT_NAMES.PREVIOUS:
107-
this.moveHighlightBy_(0, -1);
108-
return true;
109-
case Constants.SHORTCUT_NAMES.NEXT:
110-
this.moveHighlightBy_(0, 1);
111-
return true;
112-
case Constants.SHORTCUT_NAMES.OUT:
113-
this.moveHighlightBy_(-1, 0);
114-
return true;
115-
case Constants.SHORTCUT_NAMES.IN:
116-
this.moveHighlightBy_(1, 0);
117-
return true;
118-
default:
119-
return false;
120-
}
121-
}
122-
// If we haven't already handled the shortcut, let the default Field
123-
// handler try.
124-
return Blockly.Field.prototype.onShortcut.call(this, shortcut);
125-
}
126-
12785
/**
12886
* Handles the given keyboard shortcut.
12987
* This is only triggered when keyboard accessibility mode is enabled.

0 commit comments

Comments
 (0)