Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closing modal on esc #1010

Merged
merged 1 commit into from
Dec 22, 2024
Merged

Closing modal on esc #1010

merged 1 commit into from
Dec 22, 2024

Conversation

BudzioT
Copy link
Collaborator

@BudzioT BudzioT commented Dec 21, 2024

Fixes #1006

Copy link

vercel bot commented Dec 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
high-seas ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2024 3:34pm

Copy link
Contributor

@Gitstar-OC Gitstar-OC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, I was going to work on it but instead of useEffect simply adding a esc key to the Back to Matchup button : )

useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === 'Escape' && !hideCloseButton) {
close(event)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding event to close to match the calling signature of onClick={close} is v smart :)

@malted malted merged commit a9f6a0a into main Dec 22, 2024
3 checks passed
@malted malted deleted the escape_modals branch December 22, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

escape key should close modals!
3 participants