fix shift-up focus issue and enter-key always clearing focus
This commit is contained in:
parent
792b52a77c
commit
e14b09c904
2 changed files with 15 additions and 2 deletions
|
|
@ -34,8 +34,18 @@ let defaultin_plugin = (function () {
|
||||||
}
|
}
|
||||||
inputfield.val(""); // Clear this inputfield
|
inputfield.val(""); // Clear this inputfield
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
|
||||||
inputfield.blur();
|
// enter key by itself should toggle focus
|
||||||
|
if( inputfield.length < 1 ) {
|
||||||
|
inputfield = $(".inputfield:last");
|
||||||
|
inputfield.focus();
|
||||||
|
if( inputfield.length < 1 ) { // non-goldenlayout backwards compatibility
|
||||||
|
$("#inputfield").focus();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
inputfield.blur();
|
||||||
|
}
|
||||||
|
} // else allow building a multi-line input command
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Anything else, focus() a textarea if needed, and allow the default event
|
// Anything else, focus() a textarea if needed, and allow the default event
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,9 @@ let history = (function () {
|
||||||
// Doing a history navigation; replace the text in the input and
|
// Doing a history navigation; replace the text in the input and
|
||||||
// move the cursor to the end of the new value
|
// move the cursor to the end of the new value
|
||||||
var inputfield = $(".inputfield:focus");
|
var inputfield = $(".inputfield:focus");
|
||||||
|
if( inputfield.length < 1 ) { // focus the default (last), if nothing focused
|
||||||
|
inputfield = $(".inputfield:last");
|
||||||
|
}
|
||||||
if( inputfield.length < 1 ) { // pre-goldenlayout backwards compatibility
|
if( inputfield.length < 1 ) { // pre-goldenlayout backwards compatibility
|
||||||
inputfield = $("#inputfield");
|
inputfield = $("#inputfield");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue