Skip to content

can't close any modal with Escape, focus leaks behind overlay, setTimeout race on fast clicks #362

Description

@avinxshKD

onRequestClose is literally commented out in ParentModal.jsx so Escape does nothing across all 9+ modals. Tab key also escapes the overlay freely. setTimeout IDs go through useState so clearTimeout uses stale IDs, open/close fast and animations glitch. affects every modal in the app.

to reproduce:
open any modal => press Escape => nothing happens
open a modal => quickly close and reopen => animation glitches
open a modal => press Tab repeatedly => focus leaves the modal

fix can be: switch timer IDs to useRef, uncomment/fix onRequestClose, add react-focus-lock or manual focus trap, add document.body.style.overflow = 'hidden' on open.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions