mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-02 21:12:02 +08:00
Bugfix: inputosaurus failed due to changes
This commit is contained in:
parent
88b0bc1a25
commit
b0e3020aab
2 changed files with 10 additions and 10 deletions
9
dev/External/User/ko.js
vendored
9
dev/External/User/ko.js
vendored
|
@ -77,12 +77,9 @@ ko.bindingHandlers.emailsTags = {
|
|||
: null;
|
||||
},
|
||||
parseHook: input =>
|
||||
input.map(inputValue => {
|
||||
const values = EmailModel.parseEmailLine(inputValue);
|
||||
return values.length ? values : inputValue;
|
||||
}).flat(Infinity).map(
|
||||
item => (item.toLine ? [item.toLine(false), item] : [item, null])
|
||||
),
|
||||
input.map(inputValue => EmailModel.parseEmailLine(inputValue))
|
||||
.flat(Infinity)
|
||||
.map(item => (item.toLine ? [item.toLine(false), item] : [item, null])),
|
||||
onChange: value => {
|
||||
element.EmailsTagsValue = value;
|
||||
fValue(value);
|
||||
|
|
11
vendors/inputosaurus/inputosaurus.js
vendored
11
vendors/inputosaurus/inputosaurus.js
vendored
|
@ -80,7 +80,7 @@ this.Inputosaurus = class {
|
|||
self.input.addEventListener('focus', () => self._focusTrigger(true));
|
||||
self.input.addEventListener('blur', () => {
|
||||
// prevent autoComplete menu click from causing a false 'blur'
|
||||
self._parseInput();
|
||||
self._parseInput(true);
|
||||
self._focusTrigger(false);
|
||||
});
|
||||
self.input.addEventListener('keydown', e => {
|
||||
|
@ -97,7 +97,7 @@ this.Inputosaurus = class {
|
|||
self._updateDatalist();
|
||||
} else if (e.key == 'Enter') {
|
||||
e.preventDefault();
|
||||
self._parseInput();
|
||||
self._parseInput(true);
|
||||
}
|
||||
});
|
||||
self.input.addEventListener('input', () => {
|
||||
|
@ -148,8 +148,11 @@ this.Inputosaurus = class {
|
|||
datalist.textContent = '';
|
||||
}
|
||||
|
||||
_parseInput() {
|
||||
this._parseValue(this.input.value) && (this.input.value = '');
|
||||
_parseInput(force) {
|
||||
let val = this.input.value;
|
||||
if (force || val.includes(',') || val.includes(';')) {
|
||||
this._parseValue(val) && (this.input.value = '');
|
||||
}
|
||||
this._resizeInput();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue