3min chapter

Syntax - Tasty Web Development Treats cover image

Modals, Popups, Popovers, Lightboxes

Syntax - Tasty Web Development Treats

CHAPTER

How to Close a Modal When You Hit Escape

This is something I ran into on my own Check out the elitics my check out is in a modem and You are typing in an input box that is focused on an imp on a modal and you hit escape. What should that do should that unfocus the input or should it close the modal? Right I think you I think at first it should unfocus and then it should close themodal But like who wants to have a modal accidentally closed while they're submitting their payment information That's exactly it. So I don't feel and like talking asking on Twitter I was like yeah, like the way you did is probably better than than what they're recommending.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode