Don't Waste Your Time Building Custom Dialogs

Поділитися
Вставка
  • Опубліковано 14 жов 2024

КОМЕНТАРІ • 30

  • @IvanKleshnin
    @IvanKleshnin 7 місяців тому

    Wow, this is so much easier than using Headless UI Dialog + Transition components. Thank your for the video.

  • @nikitaliakhovka3489
    @nikitaliakhovka3489 Рік тому +8

    tailwind has an `open` modifier to conditionally add styles when a or element is in an open state, e.g. open:opacity-100

    • @frontendfyi
      @frontendfyi  Рік тому +4

      This is so true!! You are right. Tailwind keeps adding so many features that I often forget what’s included. Amazing comment, thanks for adding that! 😁

  • @JustSall
    @JustSall Рік тому

    Great Video. I have always struggled building Modal with forms. This makes it so much easier

  • @ThugLifeModafocah
    @ThugLifeModafocah Рік тому +1

    This is indeed AWESOME. Thanks for showing me.

  • @rithalius8219
    @rithalius8219 Рік тому

    That was exactly what I need. Thanks a lot. Liked and subscribed.

  • @CanisLatransMedia
    @CanisLatransMedia 10 місяців тому

    Thank you, great video! Is it possible to animate dialog element with framer motion? Struggling to find a solution for it :/ 🙌🏽

  • @a_maxed_out_handle_of_30_chars

    thank you, this helped me a lot :)

  • @RomanFilenko
    @RomanFilenko Місяць тому

    Thanks, great video❤. Any hack how to battle body scroll when dialog is opened? Overflow:hidden is not the option, makes layout shift.

    • @frontendfyi
      @frontendfyi  Місяць тому

      Thank you!
      As for the shift you probably want to add scrollbar-gutter: stable; this prevents the document from shifting when a scrollbar appears and disappears

  • @amitakolkar2389
    @amitakolkar2389 Рік тому

    Hi, Nice way to build a modal. But as.a part of accessibility focus needs to be trapped. Not sure but focus is not trapping in modal
    recently? Any idea?

  • @Pareshbpatel
    @Pareshbpatel 8 місяців тому

    A clear tutorial on the new HTML Dialog Element. Thanks.
    {2024-02-16}, {2024-03-19}

  • @alintdg9896
    @alintdg9896 Рік тому

    Amazing video!

  • @Sahil-me5kg
    @Sahil-me5kg Рік тому

    Nice Video ! just wanted to ask that sudden jump while closing dialog fixes if we make the inset-0 but it ocurrs if we scroll a bit if there is fixed navbar on top even if inset-0 is applied but works perfectly if no scroll . Any suggestions how to fix that ?

  • @armandsalle8447
    @armandsalle8447 Рік тому

    wao nice 🙌 I will test if it can be used for popover or side sheet!

    • @frontendfyi
      @frontendfyi  Рік тому +1

      Perhaps using the show method instead of showmodal then makes more sense. Definitely try that!

  • @equistenelabs
    @equistenelabs Рік тому

    very useful example!
    What browser are you using for these examples?

    • @frontendfyi
      @frontendfyi  Рік тому +1

      Thanks! I’m using the Arc browser.

  • @harpo187bling
    @harpo187bling 9 місяців тому

    When i use this it does not trap the focus. I can tab onto the address bar.

  • @FlorianRumpel
    @FlorianRumpel Рік тому

    Thank you it helped a lot but my modal isnt centered. Do you know why?

    • @frontendfyi
      @frontendfyi  Рік тому

      Try adding position fixed and inset 0 to your modal. That should work I think.

    • @FlorianRumpel
      @FlorianRumpel Рік тому

      @@frontendfyi Thank you very much

  • @Happyday-nn6rh
    @Happyday-nn6rh Рік тому

    nice your work ❤‍🔥

  • @DavidsKanal
    @DavidsKanal 3 місяці тому

    I am now wasting my time building native dialogs instead 💪

    • @frontendfyi
      @frontendfyi  3 місяці тому

      Hahaha. It’s so fun though! If you liked this you’ll probably love the video that drops next week too!

  • @MicheleStaffiere
    @MicheleStaffiere Рік тому +1

    should have just made the video using base JS and CSS. not Tailwind...

    • @frontendfyi
      @frontendfyi  Рік тому

      I’m sorry to hear you don’t like tailwind

    • @naylord5
      @naylord5 Рік тому +3

      There are two types of people, the ones who are already using tailwind and the others than doesn't tried yet..
      Trust me, once you try it, there is no coming back.