Keyboard Support in WinUI AutoComplete
18 Nov 20181 minute to read
This section explains the keyboard shortcuts that are supported by the SfAutoComplete control.
All keys described in the following tables work when the AutoComplete control has focus. The drop-down must be open for the navigation keys to take effect.
Drop-down open and close
The following table explains the keyboard shortcuts for opening and closing the drop-down.
| Key or Key combinations | Behavior |
|---|---|
| Escape | If the drop-down is already open, pressing the Escape key will cancel the selection and close the drop-down. |
| Tab, Shift+Tab | If the drop-down is already open, pressing the Tab or Shift+Tab key will update the selected item and close the drop-down. |
Item navigation
The following table explains how to use the keyboard shortcuts to navigate and highlight the items in a drop-down list.
| Key or Key combinations | Single selection mode | Multiple selection mode |
|---|---|---|
| Up, Ctrl+Up, Shift+Up | Moves the focus and selection to the previous item from the current focused item. | Moves the focus to the previous item from the current focused item. |
| Down, Ctrl+Down, Shift+Down | Moves the focus and selection to the next item from the current focused item. | Moves the focus to the next item from the current focused item. |
| Home | Moves the focus and selection to the first item in the drop-down. | Moves the focus to the first item in the drop-down. |
| End | Moves the focus and selection to the last item in the drop-down. | Moves the focus to the last item in the drop-down. |
| PageUp | Moves the focus and selection up by one page of items. | Moves the focus up by one page of items. |
| PageDown | Moves the focus and selection down by one page of items. | Moves the focus down by one page of items. |
| Enter | Selects the highlighted item and closes the drop-down. | Selects the highlighted item and closes the drop-down. |
Token navigation (multiple selection mode)
The following table explains the keyboard shortcuts for navigating the selected item tokens when the AutoComplete is in multiple selection mode. These keys work when the textbox has focus and there is at least one selected item.
| Key or Key combinations | Multiple selection mode |
|---|---|
| Left | Moves the focus among the selected item tokens from right to left. |
| Right | Moves the focus among the selected item tokens from left to right. |
| Ctrl+A | Selects all items in the drop-down list. |
| Backspace, Delete | Removes the focused token from the selection. |