Skip to content

Commit

Permalink
remove unneeded toggle focus
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed May 9, 2023
1 parent cad87fc commit 1d0fa0f
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ export const SelectFooter: React.FunctionComponent = () => {
const [selected, setSelected] = React.useState<string>('Select a value');
const menuRef = React.useRef<HTMLDivElement>(null);

const onToggleClick = (ev: React.MouseEvent) => {
ev.stopPropagation(); // Stop handleClickOutside from handling
setTimeout(() => {
if (menuRef.current) {
const firstElement = menuRef.current.querySelector('li > button:not(:disabled), li > a:not(:disabled)');
firstElement && (firstElement as HTMLElement).focus();
}
}, 0);
const onToggleClick = () => {
setIsOpen(!isOpen);
};

Expand Down

0 comments on commit 1d0fa0f

Please sign in to comment.