From fd7e5f685a75c8d0bcc4fba0ff712f8d8521a355 Mon Sep 17 00:00:00 2001 From: "Evan W. Patton" Date: Mon, 4 Mar 2019 09:27:18 -0500 Subject: [PATCH] Update Closure Library to fix typeblocking autocomplete Change-Id: Ia732cb6a35725ef49bb5605f1ab0bc6a808fe33b --- .gitmodules | 2 +- appinventor/blocklyeditor/src/typeblock.js | 10 +++++++++- appinventor/lib/closure-library | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 330aacac513..4ad1fbc3bce 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/mit-cml/blockly.git [submodule "appinventor/lib/closure-library"] path = appinventor/lib/closure-library - url = https://github.com/google/closure-library.git + url = https://github.com/mit-cml/closure-library.git diff --git a/appinventor/blocklyeditor/src/typeblock.js b/appinventor/blocklyeditor/src/typeblock.js index ca1392c662a..c9bf0079697 100644 --- a/appinventor/blocklyeditor/src/typeblock.js +++ b/appinventor/blocklyeditor/src/typeblock.js @@ -170,6 +170,10 @@ Blockly.TypeBlock.prototype.handleKey = function(e){ case 34: // Page Down case 35: // Shift case 36: // End + case 37: // Left Arrow + case 38: // Up Arrow + case 39: // Right Arrow + case 40: // Down Arrow case 45: // Ins case 91: // Meta case 112: // F1 @@ -197,8 +201,12 @@ Blockly.TypeBlock.prototype.handleKey = function(e){ // Can't seem to make Firefox display first character, so keep all browsers from automatically // displaying the first character and add it manually. e.preventDefault(); + if (e.charCode == 0) { + // Don't try to render a non-printing character. + return; + } goog.dom.getElement(this.inputText_).value = - String.fromCharCode(e.charCode != null ? e.charCode : e.keycode); + String.fromCharCode(e.charCode != null ? e.charCode : e.keyCode); } }; diff --git a/appinventor/lib/closure-library b/appinventor/lib/closure-library index effb4062e34..91eccc0185c 160000 --- a/appinventor/lib/closure-library +++ b/appinventor/lib/closure-library @@ -1 +1 @@ -Subproject commit effb4062e34576a011e788a0d33c1433a677f940 +Subproject commit 91eccc0185c296aa9eda3e025cf186469895e84b