Skip to content

Commit

Permalink
pkp/pkp-lib#9592 Clear input on blur (pkp#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec authored Feb 21, 2024
1 parent bf37079 commit 8b8ba22
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/Form/fields/FieldBaseAutosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
class="pkpFormField--autosuggest__autosuggest"
v-bind="autosuggestOptions"
@selected="selectSuggestion"
@blur="onInputBlur"
/>
<div
v-if="currentPosition === 'below'"
Expand Down Expand Up @@ -350,6 +351,17 @@ export default {
);
},
/**
* #9592 On input blur its good to clear inputValue, otherwise it might look like saved
* Delay is necessary so it does not interfere with blur which is triggered when option is
* selected from the list
*/
onInputBlur() {
setTimeout(() => {
this.inputValue = '';
}, 200);
},
/**
* Update the padding on the input field when selections
* are changed
Expand Down

0 comments on commit 8b8ba22

Please sign in to comment.