Skip to content

Commit

Permalink
fix: dropdown items are not moving to the next tab index due to stopP…
Browse files Browse the repository at this point in the history
…rogation
  • Loading branch information
sravichandran-eightfold committed Nov 13, 2024
1 parent bcc45e3 commit fc340b2
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/components/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,16 @@ export const Dropdown: FC<DropdownProps> = React.memo(
};

const handleFloatingKeyDown = (event: React.KeyboardEvent): void => {
event.stopPropagation();
if (event?.key === eventKeys.ESCAPE) {
toggle(false)(event);
}
if (event?.key === eventKeys.TAB) {
event.preventDefault();
timeout && clearTimeout(timeout);
timeout = setTimeout(() => {
if (!refs.floating.current.matches(':focus-within')) {
toggle(false)(event);
}
}, NO_ANIMATION_DURATION);
const menuButtonEvent: HTMLButtonElement =
document.activeElement as HTMLButtonElement;
menuButtonEvent?.focus?.();
}
if (event?.key === eventKeys.TAB && event.shiftKey) {
timeout && clearTimeout(timeout);
Expand Down

0 comments on commit fc340b2

Please sign in to comment.