react-phone-input-2 icon indicating copy to clipboard operation
react-phone-input-2 copied to clipboard

Dropdown button should be a button element, not a div

Open mtford90 opened this issue 4 years ago • 3 comments

The dropdown button should be a button, not a div.

With it being a div - it's not possible to "tab" to the button, nor is it possible to use the :focus pseudoclass when customising the style via the buttonClass prop.

mtford90 avatar Nov 26 '20 11:11 mtford90

So the inner element has div role="button" but the button class targets the outer div rather the button.

mtford90 avatar Nov 26 '20 12:11 mtford90

@bl00mber - any updates on this?

hetpatel33 avatar May 17 '21 09:05 hetpatel33

As an extension of this issue regarding accessibility, I think the dropdown button should be put before rather than after the input in the DOM to respect the tabbing order through the page as well. I tried moving it manually in the browser dev tool and see no problem so far.

vitokhangnguyen avatar Oct 13 '21 20:10 vitokhangnguyen