Skip to content

Commit

Permalink
Prevent double save on Enter key by calling blur event on keyup (#62)
Browse files Browse the repository at this point in the history
`<cms-quick-edit>` component.
  • Loading branch information
filipjakub authored Sep 15, 2022
1 parent 69018d0 commit ce5286b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion template/assets/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ Vue.component('cms-quick-edit', {
Vue.component('cms-quick-edit-text', {
props: ['value', 'elementKey'],
template: `<b-input-group>
<b-form-input v-model="newValue" :id="elementKey" size="sm" @keyup.enter.native="save()" @blur="save()"></b-form-input>
<b-form-input v-model="newValue" :id="elementKey" size="sm" @keyup.enter.native="$event.target.blur()" @blur="save()"></b-form-input>
<b-input-group-append>
<b-button size="sm" type="submit" variant="success" @click="save()">Save</b-button>
</b-input-group-append>
Expand Down

0 comments on commit ce5286b

Please sign in to comment.