Merge pull request #3 from github/commit-to-value-on-tab-press
handle 'Tab' keypresses the same way as 'Enter' is handled
This commit is contained in:
Коммит
833026ed48
|
@ -100,6 +100,14 @@ export default class Autocomplete {
|
|||
event.preventDefault()
|
||||
}
|
||||
break
|
||||
case 'Tab':
|
||||
{
|
||||
const selected = this.results.querySelector('[aria-selected="true"]')
|
||||
if (selected) {
|
||||
this.commit(selected)
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'Enter':
|
||||
{
|
||||
const selected = this.results.querySelector('[aria-selected="true"]')
|
||||
|
|
Загрузка…
Ссылка в новой задаче