2022-04-21
1159
#html
Amit Merchant
101214
Apr 21, 2022 â‹… 4 min read

Why you should be using the dialog element

Amit Merchant Software developer, writer, artist, and noob gardener.

Recent posts:

6 CSS Tools For More Efficient And Flexible CSS Handling

6 CSS tools for more efficient and flexible CSS handling

Explore some CSS tools that offer the perfect blend of efficiency and flexibility when handling CSS, such as styled-components and Emotion.

Fimber Elemuwa
May 7, 2024 â‹… 7 min read
Leveraging React Server Components In Redwoodjs

Leveraging React Server Components in RedwoodJS

RedwoodJS announced support for server-side rendering and RSCs in its Bighorn release. Explore this feature for when it’s production-ready.

Stephan Miller
May 6, 2024 â‹… 9 min read
Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 min read
Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
View all posts

3 Replies to "Why you should be using the <code>dialog</code> element"

    1. 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.

  1. 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 🙂

Leave a Reply