dialog element
Discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the December 17th issue.

Shruti Kapoor breaks down the React2Shell exploit and discusses lessons that dev teams can take away from one of the biggest security events of the year.

React, Angular, and Vue still lead frontend development, but 2025 performance is shaped by signals, compilers, and hydration. Here’s how they compare.

Learn how to use Drizzle ORM with Expo SQLite in a React Native app, including schema setup, migrations, and type-safe queries powered by TanStack Query.
Hey there, want to help make our blog better?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
3 Replies to "Why you should be using the <code>dialog</code> element"
it’s still not nearly supported enough to use in production, check caniuse – 76%
Hey Karol,
By using it in the production I meant the dialog element is supported by all the modern browsers except a few obscure browsers, such as IE, Opera Mini, KaiOS browser, UC browser etc, that still doesn’t support the dialog element.
The market share of these browsers is fairly low at this point. And that’s why I said it’s safe to use it in the production.
You can use another way that is much simpler for detecting outside click:
“`
const listener = (event: Event) => {
if (
event.target !== collectEmail &&
event.composedPath().includes(collectEmail)
) {
return;
}
// clicked outside the `collectEmail `
};
“`
You’re welcome 🙂