Dropdown autofocus
Posted: 23 Aug 2022, 11:07
What is the proper way to autofocus a Dropdown component, so that I can start selecting an entry using the arrow (up / down) keys?
Besides setting the autofocus attribute on the component, I tried stuff like this:
But it does not work - the input only gets focus when I hit tab.
Btw. the behaviour has changed from 3.15 to 3.16. In 3.15, once I hit tab I could select an entry using the arrow keys (the menu / selection does not open). With 3.16.1, when I I hit tab, the input gets focus (blue border), and the menu / selection opens when using the arrow keys. But I cannot select an entry (using the arrow keys).
Besides setting the autofocus attribute on the component, I tried stuff like this:
Code: Select all
onMounted(() => {
nextTick(() => {
dropdownRef.focusInput.focus();
dropdownRef.focused = true;
})
}
})
Btw. the behaviour has changed from 3.15 to 3.16. In 3.15, once I hit tab I could select an entry using the arrow keys (the menu / selection does not open). With 3.16.1, when I I hit tab, the input gets focus (blue border), and the menu / selection opens when using the arrow keys. But I cannot select an entry (using the arrow keys).