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:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 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