Disable keyboard navigation #319
-
Hi! Is it possible to disable keyboard navigation? |
Beta Was this translation helpful? Give feedback.
Answered by
igordanchenko
Nov 22, 2024
Replies: 1 comment 1 reply
-
There is no setting for this, but you can implement it with a custom plugin. function DisableKeyboardNavigation({ children }: ComponentProps) {
const { subscribeSensors } = useController();
React.useEffect(
() =>
subscribeSensors(EVENT_ON_KEY_DOWN, (event) => {
if (event.key === VK_ARROW_LEFT || event.key === VK_ARROW_RIGHT) {
event.stopPropagation();
}
}),
[subscribeSensors],
);
return children;
}
// ...
<Lightbox
// ...
plugins={[({ addModule }) => addModule(createModule("DisableKeyboardNavigation", DisableKeyboardNavigation))]}
/> |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Arillaxe4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no setting for this, but you can implement it with a custom plugin.