Focus selected in LanguageDropdown

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-06-02 16:49:05 +02:00
parent 36dc15022d
commit 2c37fe26e4

View file

@ -283,7 +283,7 @@ const LanguageDropdown: React.FC<ILanguageDropdown> = ({ composeId }) => {
useEffect(() => { useEffect(() => {
if (isOpen) { if (isOpen) {
if (refs.floating.current) { if (refs.floating.current) {
(refs.floating.current?.querySelector('li a[role=\'button\']') as HTMLAnchorElement)?.focus(); (refs.floating.current?.querySelector('div[aria-selected=true]') as HTMLDivElement)?.focus();
} }
document.addEventListener('click', handleDocumentClick, false); document.addEventListener('click', handleDocumentClick, false);