mirror of https://github.com/keeweb/keeweb.git
fixed enter keypress in custom field title
This commit is contained in:
parent
8021c6bb81
commit
fa17aa4a57
|
@ -70,6 +70,7 @@ class FieldViewCustom extends FieldViewText {
|
|||
this.labelInput.bind({
|
||||
input: this.fieldLabelInput.bind(this),
|
||||
keydown: this.fieldLabelKeydown.bind(this),
|
||||
keyup: this.fieldLabelKeyup.bind(this),
|
||||
keypress: this.fieldLabelInput.bind(this),
|
||||
mousedown: this.fieldLabelInputClick.bind(this),
|
||||
click: this.fieldLabelInputClick.bind(this)
|
||||
|
@ -130,9 +131,7 @@ class FieldViewCustom extends FieldViewText {
|
|||
fieldLabelKeydown(e) {
|
||||
e.stopPropagation();
|
||||
const code = e.keyCode || e.which;
|
||||
if (code === Keys.DOM_VK_RETURN) {
|
||||
this.endEditTitle(e.target.value);
|
||||
} else if (code === Keys.DOM_VK_ESCAPE) {
|
||||
if (code === Keys.DOM_VK_ESCAPE) {
|
||||
this.endEditTitle();
|
||||
} else if (code === Keys.DOM_VK_TAB) {
|
||||
e.preventDefault();
|
||||
|
@ -140,6 +139,13 @@ class FieldViewCustom extends FieldViewText {
|
|||
}
|
||||
}
|
||||
|
||||
fieldLabelKeyup(e) {
|
||||
const code = e.keyCode || e.which;
|
||||
if (code === Keys.DOM_VK_RETURN) {
|
||||
this.endEditTitle(e.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
fieldValueInputClick() {
|
||||
if (this.labelInput) {
|
||||
this.endEditTitle(this.labelInput.val());
|
||||
|
|
Loading…
Reference in New Issue