core/select/select-keyboard.service.ts
This service provides keyboard navigation for dropdowns.
It allows to navigate over the items in the dropdown using the keyboard
or search for them. For this to correctly work, the service needs to provided
as component provider in the component. Additionally the ListItemComponent
needs to be used in the dropdown items. Also each item needs to have a
span[data-search-label] element to search for the item.
Properties |
Methods |
isSelectionEvent | ||||||
isSelectionEvent(event: KeyboardEvent)
|
||||||
Returns true if the keyboard event is fired by a selection event (Enter, Down, Tab, Up, Space)
Parameters :
Returns :
boolean
true if the event is a selection event. |
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
register$ | ||||||||||||||||
register$(input: HTMLInputElement, list: QueryList<ListItemComponent>, dropdown: BsDropdownDirective)
|
||||||||||||||||
Registers the keyboard event listener for the dropdown.
Parameters :
Returns :
Observable<number>
A Observable |
unregister |
unregister()
|
Unregister the keyboard event listner.
Returns :
void
|
options |
Type : object
|
Default value : {
/**
* If true, the input will be cleared when the user selects an item.
*/
emptyInput: false,
/**
* Search on key event.
*/
keyboardSearch: false
}
|
Conifguration options for the keyboard service. |