CreateModalKeyDownHandler
Function: createModalKeyDownHandler()
[object Object]
Defined in: app/components/UI/Modal/Modal.handlers.tsx:25
A factory function that creates a scoped keyboard event handler for a specific modal instance. This is useful for adding and removing event listeners in a clean, reusable way within functional components (e.g., inside a useEffect).
Parameters
onClose
() => void
The callback function that should run when the modal needs to close.
Returns
A function that accepts a KeyboardEvent and handles it via handleModalKeyDown.
(event) => void