Skip to content

Bug: Waitlist modal cannot be closed with the Escape key #96

@SG170

Description

@SG170

Bug Description

The "Join the waitlist" modal in src/components/SummerOfAI.jsx can only
be dismissed by clicking the button. Pressing the Escape key has no
effect. This is a standard accessibility expectation — all modals should
support Escape to close.

Steps to Reproduce

  1. Go to the Summer of AI section
  2. Click "Join the waitlist →"
  3. When the modal opens, press the Escape key
  4. Modal stays open — nothing happens

Expected Behavior

Pressing Escape should close the modal, the same as clicking

Proposed Fix

Add a useEffect in SummerOfAI.jsx:

useEffect(() => {
  const handleKey = (e) => { if (e.key === 'Escape') setBtn(false) }
  if (btn) window.addEventListener('keydown', handleKey)
  return () => window.removeEventListener('keydown', handleKey)
}, [btn])

Labels

bug good first issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions