blur selected text field on esc
This commit is contained in:
parent
b5588adf06
commit
42eb82d688
2 changed files with 3 additions and 8 deletions
|
|
@ -165,6 +165,7 @@ if (self.window) {
|
|||
},
|
||||
|
||||
cancel: function(data) {
|
||||
// console.log({work_cancel: data});
|
||||
if (data.id) {
|
||||
var widget = cache[data.id];
|
||||
if (widget) widget.cancel = true;
|
||||
|
|
|
|||
10
js/kiri.js
10
js/kiri.js
|
|
@ -2538,17 +2538,12 @@ self.kiri.license = exports.LICENSE;
|
|||
showSlices();
|
||||
}
|
||||
|
||||
function clearSelectedText() {
|
||||
var sel = WIN.getSelection();
|
||||
if (sel && sel.rangeCount) sel.collapseToStart();
|
||||
}
|
||||
|
||||
function keyUpHandler(evt) {
|
||||
switch (evt.keyCode) {
|
||||
// escape
|
||||
case 27:
|
||||
// clear text selection
|
||||
clearSelectedText();
|
||||
// blur text input focus
|
||||
DOC.activeElement.blur();
|
||||
// dismiss modals
|
||||
hideModal();
|
||||
// deselect widgets
|
||||
|
|
@ -2624,7 +2619,6 @@ self.kiri.license = exports.LICENSE;
|
|||
evt.preventDefault();
|
||||
widgetDeselect();
|
||||
platformSelectAll();
|
||||
clearSelectedText();
|
||||
}
|
||||
break;
|
||||
case 83: // 's' for save workspace
|
||||
|
|
|
|||
Loading…
Reference in a new issue