FIX: Inputs using focusout regressed in #17345 (#17389)

This commit is contained in:
Jarek Radosz
2022-07-08 13:00:33 +02:00
committed by GitHub
parent a084680f1d
commit 20851f7240
9 changed files with 104 additions and 14 deletions
@@ -22,17 +22,23 @@ export default Component.extend({
},
actions: {
changeKey(index, newValue) {
changeKey(index, event) {
const newValue = event.target.value;
if (this._checkInvalidInput(newValue)) {
return;
}
this._replaceValue(index, newValue, "key");
},
changeSecret(index, newValue) {
changeSecret(index, event) {
const newValue = event.target.value;
if (this._checkInvalidInput(newValue)) {
return;
}
this._replaceValue(index, newValue, "secret");
},
@@ -24,8 +24,8 @@ export default Component.extend({
},
@action
changeValue(index, newValue) {
this.collection.replace(index, 1, [newValue]);
changeValue(index, event) {
this.collection.replace(index, 1, [event.target.value]);
this.collection.arrayContentDidChange(index);
this._onChange();
},
@@ -65,7 +65,7 @@ export default Component.extend({
},
_onChange() {
this.attrs.onChange && this.attrs.onChange(this.collection);
this.onChange?.(this.collection);
},
@discourseComputed("collection")
@@ -39,8 +39,8 @@ export default Component.extend({
},
actions: {
changeValue(index, newValue) {
this._replaceValue(index, newValue);
changeValue(index, event) {
this._replaceValue(index, event.target.value);
},
addValue(newValue) {