Select field selection handling (#158)

This commit is contained in:
formsdev
2023-07-26 13:19:31 +05:30
committed by GitHub
parent b55c3e6164
commit e28d80e7da
4 changed files with 53 additions and 20 deletions

View File

@@ -122,7 +122,8 @@ export default {
data () {
return {
isOpen: false,
searchTerm: ''
searchTerm: '',
defaultValue: this.value ?? null
}
},
computed: {
@@ -212,7 +213,7 @@ export default {
this.$emit('input', emitValue)
} else {
if (this.value === value) {
this.$emit('input', null)
this.$emit('input', this.defaultValue ?? null)
} else {
this.$emit('input', value)
}