Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const handleKeyDown = (position: SheetPosition) => (
event: React.KeyboardEvent
) => {
const { key } = event;
if (key === "ArrowUp") {
event.preventDefault();
show(position, false)(event);
} else if (key === "ArrowDown") {
event.preventDefault();
show(position)(event);
}
};
const hide = () => setVisible(false);
const toggle = () => setVisible(prevVisible => !prevVisible);
useScrollLock(visible);
// const { containerProps, setActiveId } = useActiveDescendantState({
// // search: true,
// defaultActiveId: "",
// // incrementKeys: ["ArrowDown"],
// // decrementKeys: ["ArrowUp"],
// // jumpToFirstKeys: ["Home"],
// // jumpToLastKeys: ["End"],
// onKeyDown: event => {
// if (event.key === "Tab" || event.key === "Escape") {
// event.stopPropagation();
// hide();
// }
// },
// });