Skip to content
This repository has been archived by the owner on May 25, 2019. It is now read-only.

Force Selection on Blur in Autocomplete #74

Open
edivaldoms opened this issue Feb 9, 2019 · 1 comment
Open

Force Selection on Blur in Autocomplete #74

edivaldoms opened this issue Feb 9, 2019 · 1 comment

Comments

@edivaldoms
Copy link

When we type in autocomplete and do not select and if there is already a previous selection (a defined value), I suggest that when entering any other search term, the value is set to null and if no option is selected, to blur event, set the term null the research.
In summary: Clear the value when performing a new search and get null in the blur event without having made a selection.
This property could be called forceSelection: true | false

@edivaldoms
Copy link
Author

Or issue the blur event to handle this case.

`<q-autocomplete
v-model="value.person.name"
@search="search"
@selected="selected"
@blur="onBlur"
/>

onBlur: function () {
if (value.person.name == null) {
value.person.id = null
}
if (value.person.id == null) {
value.person.name = null
}
}
`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant