mirror of
https://github.com/google/blockly.git
synced 2026-01-11 19:07:08 +01:00
Removes ability to enter accessibility mode using shift click (#3538)
* Removes ability to enter accessibility mode using shift click
This commit is contained in:
@@ -496,8 +496,9 @@ Blockly.Gesture.prototype.doStart = function(e) {
|
||||
Blockly.Tooltip.block();
|
||||
|
||||
if (this.targetBlock_) {
|
||||
if (!this.targetBlock_.isInFlyout && e.shiftKey) {
|
||||
Blockly.navigation.enableKeyboardAccessibility();
|
||||
if (!this.targetBlock_.isInFlyout &&
|
||||
e.shiftKey &&
|
||||
this.targetBlock_.workspace.keyboardAccessibilityMode) {
|
||||
this.creatorWorkspace_.getCursor().setCurNode(
|
||||
Blockly.navigation.getTopNode(this.targetBlock_));
|
||||
} else {
|
||||
@@ -765,8 +766,7 @@ Blockly.Gesture.prototype.doBlockClick_ = function() {
|
||||
*/
|
||||
Blockly.Gesture.prototype.doWorkspaceClick_ = function(e) {
|
||||
var ws = this.creatorWorkspace_;
|
||||
if (e.shiftKey) {
|
||||
Blockly.navigation.enableKeyboardAccessibility();
|
||||
if (e.shiftKey && ws.keyboardAccessibilityMode) {
|
||||
var screenCoord = new Blockly.utils.Coordinate(e.clientX, e.clientY);
|
||||
var wsCoord = Blockly.utils.screenToWsCoordinates(ws, screenCoord);
|
||||
var wsNode = Blockly.ASTNode.createWorkspaceNode(ws, wsCoord);
|
||||
|
||||
@@ -89,9 +89,10 @@ suite('Gesture', function() {
|
||||
|
||||
};
|
||||
var ws = Blockly.inject('blocklyDiv', {});
|
||||
var gesture = new Blockly.Gesture(this.e, ws);
|
||||
assertFalse(ws.keyboardAccessibilityMode);
|
||||
ws.keyboardAccessibilityMode = true;
|
||||
var gesture = new Blockly.Gesture(event, ws);
|
||||
gesture.doWorkspaceClick_(event);
|
||||
assertTrue(ws.keyboardAccessibilityMode);
|
||||
var cursor = ws.getCursor();
|
||||
assertEquals(cursor.getCurNode().getType(), Blockly.ASTNode.types.WORKSPACE);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user