mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
backport of commit abd6324e50 (#22464)
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1d716d7a90
commit
13da593157
3
changelog/22458.txt
Normal file
3
changelog/22458.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
ui: fixes model defaults overwriting input value when user tries to clear form input
|
||||||
|
```
|
||||||
@@ -303,8 +303,9 @@
|
|||||||
disabled={{and @attr.options.editDisabled (not @model.isNew)}}
|
disabled={{and @attr.options.editDisabled (not @model.isNew)}}
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
value={{or (get @model this.valuePath) @attr.options.defaultValue}}
|
value={{get @model this.valuePath}}
|
||||||
{{on "change" this.onChangeWithEvent}}
|
{{on "change" this.onChangeWithEvent}}
|
||||||
|
{{on "input" this.onChangeWithEvent}}
|
||||||
{{on "keyup" this.handleKeyUp}}
|
{{on "keyup" this.handleKeyUp}}
|
||||||
class="input {{if this.validationError 'has-error-border'}}"
|
class="input {{if this.validationError 'has-error-border'}}"
|
||||||
maxLength={{@attr.options.characterLimit}}
|
maxLength={{@attr.options.characterLimit}}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ module('Integration | Component | form field', function (hooks) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const setup = async function (attr) {
|
const setup = async function (attr) {
|
||||||
const model = EmberObject.create({});
|
// ember sets model attrs from the defaultValue key, mimicking that behavior here
|
||||||
|
const model = EmberObject.create({ [attr.name]: attr.options?.defaultValue });
|
||||||
const spy = sinon.spy();
|
const spy = sinon.spy();
|
||||||
this.set('onChange', spy);
|
this.set('onChange', spy);
|
||||||
this.set('model', model);
|
this.set('model', model);
|
||||||
|
|||||||
Reference in New Issue
Block a user