Skip to content

Commit

Permalink
fix(QSelect): backspace behavior #16481
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Oct 17, 2023
1 parent 08b58f2 commit c600eae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/src/pages/vue-components/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ When QSelect is focused:
- pressing <kbd>SHIFT</kbd> + <kbd>TAB</kbd> will navigate backwards through the QChips (if a QChip is selected <kbd>TAB</kbd> will navigate forward through the QChips)
- pressing <kbd>ENTER</kbd> when a QChip is selected will remove that option from the selection
- pressing <kbd>BACKSPACE</kbd> will remove the last option from the selection (when `use-input` is set the input should be empty)
- pressing <kbd>BACKSPACE</bkd> when `clearable` is set then:
- it clears the model (with `null` value) for single selection
- it removes the last added value for multiple selection
- pressing <kbd>TAB</kbd> (or <kbd>SHIFT</kbd> + <kbd>TAB</kbd> if `use-chips` is not set or the first QChip is selected) will navigate to the next or previous focusable element on page
- typing text (<kbd>0</kbd> - <kbd>9</kbd> or <kbd>A</kbd> - <kbd>Z</kbd>) if `use-input` is not set will:
- create a search buffer (will be reset when a new key is not typed for 1.5 seconds) that will be used to search in the options labels
Expand Down
4 changes: 4 additions & 0 deletions ui/src/components/select/QSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ export default createComponent({
// backspace
if (
e.keyCode === 8
&& (
props.useChips === true
|| props.clearable === true
)
&& props.hideSelected !== true
&& inputValue.value.length === 0
) {
Expand Down

0 comments on commit c600eae

Please sign in to comment.