eui
eui copied to clipboard
[EuiComboBox] Broken keyboard interaction in `x` clear button
Describe the bug
Unable to access clear button on EuiComboBox from keyboard navigation.
- Go to https://eui.elastic.co/#/forms/combo-box
- Click to focus and open any clearable
comboBox - Make a selection so the input is filled
- Press esc to close list and tab to the
xclear button - Press enter to clear the selection
- Notice nothing happens
Clicking the x has the intended affect just not via keyboard interaction.
Just to add context -- using the space does work to trigger the x button as expected. Maybe that's the intended use. I'm not sure when or where space vs enter should be used but from this link it seems it would be better if both space & enter triggered the button.
+1, can confirm/repro the problem. FWIW, we've solved this problem in EuiSelectable (https://github.com/elastic/eui/pull/6631), so this bug will go away for free once we update EuiComboBox to dogfood EuiSelectable (https://github.com/elastic/eui/issues/2841).
The latter is on my list for the next month or so, so I'm tempted to wait until then to try and fix this issue.
In the showcase https://eui.elastic.co/#/forms/combo-box, space triggers the clear and not enter.
@hrmtn correct that's what I stated in https://github.com/elastic/eui/issues/7289#issuecomment-1766721228, the question is whether it should trigger using either space or enter not only space.