Skip to content

Commit 005a91f

Browse files
authored
feat(QSelect): delete single mode value with backspace quasarframework#6703 (quasarframework#8149)
Same conditions as in case of multiple apply: - inputValue mult be empty - hideSelected must not be active
1 parent 5ff65de commit 005a91f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ui/src/components/select/QSelect.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,12 +647,15 @@ export default Vue.extend({
647647
// backspace
648648
if (
649649
e.keyCode === 8 &&
650-
this.multiple === true &&
651650
this.hideSelected !== true &&
652-
this.inputValue.length === 0 &&
653-
Array.isArray(this.value)
651+
this.inputValue.length === 0
654652
) {
655-
this.removeAtIndex(this.value.length - 1)
653+
if (this.multiple === true && Array.isArray(this.value)) {
654+
this.removeAtIndex(this.value.length - 1)
655+
}
656+
else if (this.multiple !== true && this.value !== null) {
657+
this.$emit('input', null)
658+
}
656659
return
657660
}
658661

0 commit comments

Comments
 (0)