mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
🐛 Fixed nav item not saving updated value on keyboard save
no issue - Fixes nav item values not saving on keyboard save shortcut - Nav items value was only being updated in settings on focus out from text field. - In case of keyboard save, focus out didn't happen so old value got saved and re-populated - Change fixes to update setting value while typing
This commit is contained in:
parent
182663bdf8
commit
f8b2092f6c
@ -17,7 +17,7 @@
|
||||
@shouldFocus={{this.navItem.last}}
|
||||
@placeholder="Label"
|
||||
@value={{readonly this.label}}
|
||||
@input={{action (mut this.label) value="target.value"}}
|
||||
@input={{action "updateLabel" value="target.value"}}
|
||||
@keyPress={{action "clearLabelErrors"}}
|
||||
@focus-out={{action "updateLabel" this.label}} data-test-input="label" />
|
||||
<GhErrorMessage
|
||||
|
@ -39,6 +39,7 @@ export default Component.extend(ValidationState, {
|
||||
},
|
||||
|
||||
updateLabel(value) {
|
||||
this.set('label', value);
|
||||
return this.updateLabel(value, this.navItem);
|
||||
},
|
||||
|
||||
|
@ -104,7 +104,7 @@ describe('Integration: Component: gh-navitem', function () {
|
||||
await render(hbs`{{gh-navitem navItem=navItem baseUrl=baseUrl updateLabel=(action update)}}`);
|
||||
await triggerEvent('.gh-blognav-label input', 'blur');
|
||||
|
||||
expect(updateActionCallCount).to.equal(1);
|
||||
expect(updateActionCallCount).to.equal(2);
|
||||
});
|
||||
|
||||
it('displays inline errors', async function () {
|
||||
|
Loading…
Reference in New Issue
Block a user