The New dialog HTML Element Changes Modals Forever

  Рет қаралды 571,928

Web Dev Simplified

Web Dev Simplified

Күн бұрын

Modals have been a part of web development for decades now, but they have always been a bit of a pain to work with. The main reason modals have been such a pain is because it is difficult to make a truly accessible modal that conforms to all accessibility standards. This is why the new HTML dialog element is so exciting. The dialog element makes it so much easier to create accessible modals, and in this video I will explain everything you need to know about the dialog element to use it in your next project.
📚 Materials/References:
My Blog: blog.webdevsimplified.com
Dialog Element Article: blog.webdevsimplified.com/202...
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
00:55 - The traditional way to make modals
02:45 - Using the dialog element
08:02 - Advanced dialog element use cases
#HTMLDialog #WDS #HTML

Пікірлер: 559
@Thassalocracy
@Thassalocracy Жыл бұрын
This dialog element is amazing not just for accessibility but it comes with its own show/close API that can be easily implemented in React with a useRef hook. This should be the direction for web/mobile app development - making life easier for both the end user and developer.
@CottidaeSEA
@CottidaeSEA Жыл бұрын
It's long overdue. There have been far too many hacky ways of doing things in the frontend, these things should just exist by default. I wish the details element could receive a bit more love.
@yobebill1234
@yobebill1234 Жыл бұрын
Came to ask this question. thank you!!
@scottbrown-xveganxedgex2799
@scottbrown-xveganxedgex2799 Жыл бұрын
any way you could post small code sample of react/useRef for this?
@18.j
@18.j Жыл бұрын
@@scottbrown-xveganxedgex2799 there's plenty online, just reference the dialog and close it with the ref.current.showModal() or close()
@GeronimOCZECH
@GeronimOCZECH Жыл бұрын
Nty, I like my hard life 😆
@AntoshaPushkin
@AntoshaPushkin Жыл бұрын
Wow, I remember implementing modals like that 11-12 years ago for my pet projects back in the times when I studied at school. So surprised that only now it became a standard feature
@LV-ii7bi
@LV-ii7bi Жыл бұрын
Bureaucracy
@AntoshaPushkin
@AntoshaPushkin 11 ай бұрын
@@josiah7913 could it be so that it's from 2013, but back then it lacked a couple necessary features, and hasn't been supported until recently?
@AntoshaPushkin
@AntoshaPushkin 11 ай бұрын
@@josiah7913 I see, then it makes sense that nobody bothered using it
@colindante5164
@colindante5164 Жыл бұрын
There's multiple ways one could explain an HTML tag but Kyle's way is the absolute best. Always so grateful. Thanks much))
@encycl07pedia-
@encycl07pedia- Жыл бұрын
There are*
@colindante5164
@colindante5164 Жыл бұрын
@@encycl07pedia- the error was unintentional ( not deliberate). ))
@JDLuke
@JDLuke Жыл бұрын
One of the big advantages of a platform such as this is that many teaching styles are available, and you can find those which suit your learning style the best. That's one thing that neither college nor work will necessarily make so readily accessible.
@justepierre7330
@justepierre7330 11 ай бұрын
Just a small tip. At least on VSCode, do you know that you can change the element's tag name more easily ? Click on the tag name then press F2. It avoids having to modify the name on the closing or opening tag because it works both ways.
@requestfx5585
@requestfx5585 10 ай бұрын
Thanks
@shufflepack
@shufflepack 10 ай бұрын
on which system? doesn't work for me
@justepierre7330
@justepierre7330 10 ай бұрын
@@shufflepack MS Windows, F2 is the default key to rename things on Windows (files, folders, etc.)
@Arinze1
@Arinze1 10 ай бұрын
Thanks
@Gabriel-iq6ug
@Gabriel-iq6ug 9 ай бұрын
Ctrl+d / CMD+d as well
@MikkoRantalainen
@MikkoRantalainen Жыл бұрын
Great video! I was already aware of but you explained some features that make it worth using (especially the keyboard accessibility with modal dialogs). Previously I didn't see any point using this instead of JS implementation I already had implemented.
@albedesigns
@albedesigns 11 ай бұрын
I'm kinda new around here so I didn't know about your blog - excited to see the amazing content you have on there!
@ezra3457
@ezra3457 Жыл бұрын
I just spent a good chunk of time creating a model for a project . Nice to see the simplicity of this new html element. Thank you!
@christianwatson6500
@christianwatson6500 Жыл бұрын
Was just about to create one and this popped up… 😮
@waffletube5707
@waffletube5707 8 ай бұрын
@@christianwatson6500 same
@mrhaiku4399
@mrhaiku4399 Жыл бұрын
Great content and presentation/demo. Thanks!
@CirTap
@CirTap Жыл бұрын
Thanks for bringing this to people's attention👏. I am currently "migrating" from A11yDialog (which is great btw) to native, now that implementations got so much better over the last couple of years. Also saves so much custom and library code all over: HTML, CSS, JS; from several kb to a few dozen lines all across.
@waffletube5707
@waffletube5707 8 ай бұрын
Thanks for bringing up a11y-dialog. So you'd recommend just using this method over a11y-dialog? Is this method as accessible as a11y-dialog?
@FirdausAziz
@FirdausAziz Жыл бұрын
Thanks for highlighting things that can be done with native/raw HTML.
@onildo_costa
@onildo_costa Жыл бұрын
Holy, I was just searching this 3 days ago. Now you just make my day bro, thanks!
@tripwitt5
@tripwitt5 Жыл бұрын
Mind blown. Best tutorial ever! Thank you!
@andrebotha5270
@andrebotha5270 Жыл бұрын
Kyle, you nailed it again man. Well done. Very useful content. 👏🏻👏🏻👏🏻
@ElijahScott10x
@ElijahScott10x Жыл бұрын
Awesome! Dialogs and modals has always been a pain point in front-end dev.
@TheDragShot
@TheDragShot Жыл бұрын
They always seemed relatively straightforward to me when using a css/js framework like Bootstrap, but at least now it should be even simpler since it's becoming a base feature of HTML5.
@HaithamAli-fy8vo
@HaithamAli-fy8vo Жыл бұрын
@@TheDragShotthe fact that you rely on a framework to do it proves the OPs point
@0LoneTech
@0LoneTech 11 ай бұрын
Of course, they're even more of a pain to the user. I can't remember when I last saw a web page modal that wasn't there purely to obstruct normal use.
@tljoshh
@tljoshh Жыл бұрын
Neat! I had no idea about any of this! Definitely going to make use of these in future
@dannyezechukwu1175
@dannyezechukwu1175 5 ай бұрын
It is incredible how informative and efficient these videos are. Thank you so much!
@rooneyjohn
@rooneyjohn Жыл бұрын
You are my hero. Your videos are always amazing, straight to the point, and useful!!
@StefanKressCH
@StefanKressCH Жыл бұрын
The best feature imho are stacked modals. If you try to create a modal inside a modal the old fashioned way with the outer modal(overflow:hidden), it will display the stacked (inner) modal only inside the already opened modal. With you're completely free to stack and overflow as you like.
@encycl07pedia-
@encycl07pedia- Жыл бұрын
What's the use case of a stacked modal?
@Sk4lli
@Sk4lli Жыл бұрын
@@encycl07pedia- Maybe confirmation dialog? Asking before submitting changes or showing error message...
@AbNomal621
@AbNomal621 11 ай бұрын
@@encycl07pedia- it is excellent way to provide a sub-par interface. And the “easiest” way is to provide a confirmation to some action inside a modal. Users will then know that you study (low) quality UI.
@heydaddy59
@heydaddy59 Жыл бұрын
Amazing! :O Kyle is like your mentor who knows better and modern ways to do things in web! Thank you!
@jacorachan
@jacorachan Жыл бұрын
Great video, short and to the point. You have a new sub!
@zigggen
@zigggen 11 ай бұрын
Other way to handle click outside is to listen on click for dialog element and, add `e.stopPropogation` for dialog body. This can also handle the edge case when border is rounded.
@shaunpx1
@shaunpx1 Жыл бұрын
Love that Jackson bro! I have a black Jackson Kelly Pro with the flame headstock. Great video too, thanks!
@claudiusraphael9423
@claudiusraphael9423 Жыл бұрын
Wow .. massive demonstration of enthusiasm and structured presentation for information sake - thanks for sharing!
@ashimov1970
@ashimov1970 Жыл бұрын
Ma sha Allah! That's really aewsome. Thank you Kyle for sharing the update!
@eidenblock
@eidenblock Жыл бұрын
Man, thank you very much for what you do. You really help people.
@Grouiiiiik
@Grouiiiiik Жыл бұрын
Pretty neat. I like that it's allowing to close with the escape key by default. It would be a bit cleaner to wrap the contents of the dialog rather than using coordinates on click though. Then it's just : `dialog.addEventListener('click', e => e.target !== wrapper && dialog.close())`
@The14Some1
@The14Some1 Жыл бұрын
this also solves a non-rectangular or rounded corners dialog issues.
@The14Some1
@The14Some1 Жыл бұрын
Well, maybe it is better to check whether the backdrop clicked or not rather wrapping it?
@Grouiiiiik
@Grouiiiiik Жыл бұрын
@@The14Some1 yes it would be better.. but you can't check clicks on pseudo elements.
@VaclavSir
@VaclavSir 11 ай бұрын
Your code would close the dialog when user clicks on another element inside the wrapper. The condition should rather use the contains method: `wrapper.contains(e.target)`
@alexmephors
@alexmephors Жыл бұрын
Awesome can't wait to try it on future projects
@miromargineanu4712
@miromargineanu4712 Жыл бұрын
Amazing information once again, Kyle! Thank you. 👍 There's one single thing that I wish was covered, but perhaps it was left out due to the complexity involved. I'm developing in React and most of our applications require way more complexity of handling modals than a single one per page or application. How would this work with multiple modals being triggered from the same location? Not overlapping, obviously, but perhaps I have an extremely custom layout with multiple flows that can be triggered from the same location. I do believe you'd eventually dig into unique identifiers, but I'm just wondering if it has support for that at all. Nonetheless, gold information right here. We can finally start dropping libraries handling stuff like this. Will dive into how this could be implemented in React with Redux perhaps or with programatically triggering these modals. Much appreciated!
@scottbrown-xveganxedgex2799
@scottbrown-xveganxedgex2799 Жыл бұрын
did you find anything yet? I've been looking as well.
@vasyaqwe2087
@vasyaqwe2087 Жыл бұрын
been using this one for a looong time now. Amazing
@vipex.v
@vipex.v Жыл бұрын
Really Helpful, thank you mane!
@techtipsuk
@techtipsuk Жыл бұрын
Just needing to do one of these thanks, perfect timing
@irs-mp
@irs-mp Жыл бұрын
😲 you are amazing, thank you so much for sharing your knowledge. 👏👏👏
@petarkolev6928
@petarkolev6928 Жыл бұрын
Kyle, amazing and super useful video! Thank you 🍻🍻
@jennifershen4273
@jennifershen4273 Жыл бұрын
OMG!!! This is soooo convenient! Thanks for sharing!
@MrFanBoyDee
@MrFanBoyDee Жыл бұрын
always clear, concise and knowledgeable
@chinmayghule8272
@chinmayghule8272 Жыл бұрын
I've seen your blog website and it's awesome. But I hope you would add some basic features to it, like a "Back to Top" button on the individual blog page, a sidebar containing the table of contents on the individual blog page so that the user would be able to jump to the content they want to read, a comment section below the blogs, etc.
@robertholtz
@robertholtz Жыл бұрын
Rather than introduce complexity with getBoundingClientRect (which may potentially trigger all kinds of false positives from dropdown menus, rounded corners, and other dialog interaction that may overflow the cursor rectangle target), why not simply wrap the content inside the dialog with a div and set an event listener that closes the dialog when that content wrapper div loses focus? In fact, I wonder if the dialog object itself might not also raise a blur event somewhere that we can detect and handle. Awesome video, in any case, Kyle.
@dsego84
@dsego84 Жыл бұрын
Yeah, even without the div, seems like it should be possible to get the actual target in the bubbling phase and compare selector to check if it is the backdrop element or not.
@robertholtz
@robertholtz Жыл бұрын
@@dsego84 As a result of this discussion, I've been toying around with this in CodePen and have not been able to trap the actual target natively. The main problem is that the full page backdrop is part of the modal. In effect, when the modal is open, all clicks all over the page are regarded by the DOM to still be inside the modal. In practice, there is no way for the modal to lose focus at runtime while open. The div trick works. It's a decent workaround (a better workaround than getBoundingClientRect in my opinion) but it's not perfect. The div style must be forced edge to edge to occupy the entire dialog. If you don't do that, a click on any whitespace inside the dialog but outside the div counts as a blur event and the dialog closes. I now share Kyle's frustration, all of these tricks should be future polyfill. Truth is, the dialog object itself should natively raise an event when the backdrop is clicked. Even easier, I'd love a property we could simply set to change the modal behavior to make it close on such a click. Frankly, if we are making a wish list, I'd like both. In fact, I'd also like the backdrop to be a property of the dialog object instead of a pseudo style. My current assessment is the dialog tag is a big improvement on the usual hassles with modals but the implementation is only about 90% there. I'm still experimenting to find a universal elegant solution for modal close-on- blur. My gut still tells me that something else somewhere must bubble to the DOM that we can use as a trigger.
@dsego84
@dsego84 Жыл бұрын
@@robertholtz Wow, thanks for poking around. Agreed the div trick is a decent workaround. Too bad it's not possible to trap the target natively. Thanks for the write-up as well!
@krzysztofrozbicki1776
@krzysztofrozbicki1776 Жыл бұрын
It`s good idea but you have to be careful and be aware that dialog element has many default styling properties (e.g. default 1em padding)
@robertholtz
@robertholtz Жыл бұрын
@@krzysztofrozbicki1776 You are quite right. I pointed that out later in the thread when I started actually testing this out. You must override dialog's default styling and make sure your control div spans edge-to-edge of the entire dialog. Any click on the whitespace inside the dialog but outside the div counts as a trigger and the dialog closes. I'm still looking for a more elegant solution but I believe this is still better than getBoundingClientRect. With the div approach, not overriding the default dialog padding is the only way I have found that may raise a false positive but that has an easy fix. In contrast, getBoundingClientRect has many potential false positive scenarios, some of which are so involved to guard against that it nets out to be far less work to just do modals the traditional way. I prefer modals that close on blur and I want to take advantage of dialog's baked-in behavior. The div trick enables developers like me to achieve both. My quest continues for a still-better detection method.
@darthvulture
@darthvulture Жыл бұрын
great and easy explanation of everything here, what a nice feature!
@LePhenixGD
@LePhenixGD Жыл бұрын
8:41 I've been familiar with modals for over a year, but it wasn't until I watched your video that I discovered the save form inputs feature doesn't require JS. That's a fantastic revelation! 7:50 I have a small tip for those who declare global CSS variables using :root{}. Keep in mind that you cannot apply them to the backdrop because they are considered 'undefined' within the same module level as the :root{} and they're considered out of scope
@puneetsharma1437
@puneetsharma1437 Жыл бұрын
I am doing that over a year
@MaverickDriver95
@MaverickDriver95 Жыл бұрын
The top for 7:50 is good info. How would you fix this?
@RogerHNobrega
@RogerHNobrega Жыл бұрын
I always watch Kyle's videos before I sleep... This time I dozed off with my hand on the phone's keyboard. Sorry for the emoji spam lol Spent 10 minutes deleting emojis here
@IStMl
@IStMl Жыл бұрын
@@RogerHNobrega wtf
@RogerHNobrega
@RogerHNobrega Жыл бұрын
@@IStMl Sorry bro! read the above comment lol
@alexudodov7841
@alexudodov7841 Жыл бұрын
Wow, that's amazing! Thank you! 🔥
@conradohernanvillagil2764
@conradohernanvillagil2764 Жыл бұрын
Great video. Thank you. I suggest for next video a practice about a carousel of images and modal window show us the image. When user click on the image , image pop up and and the other images fade.
@RedrumZT
@RedrumZT Жыл бұрын
Wow, great video, nice feature, I have so many ideas to implement it.
@anthonypetruzzi158
@anthonypetruzzi158 Жыл бұрын
Jesus... I'm been missing your videos. Just noticed that I wasn't subscribed to "all". Fix now 🤗Keep up the great work you are doing Kyle!!!
@ando_rei
@ando_rei Жыл бұрын
That is a real nice introduction to the dialog element! I was aware of it, but did not dive into details until now. Since I was a little set back by the whole "getBoundingClientRect"-thing, I prodded a little bit around. Although you can not distinguish between Dialog and Backdrop on click, you can, however, get rid of the "getBoundingClientRect".  The PointerEvent has "offsetX/Y" properties which are negative when the click is left of or above the dialog. Further "offsetX > modal.offsetWidth" holds for clicks right of the dialog and conversely "offsetY > modal.offsetHeight" for clicks below the dialog.  I do not know, however, if this still holds for very big dialogs - still could, I guess.
@maazahmad9756
@maazahmad9756 Жыл бұрын
bruh, it was introduced in chromium 37 (2014). we just weren't focusing on it all this time ;)
@railroadandindustrialsky-wv8ns
@railroadandindustrialsky-wv8ns 5 ай бұрын
Gorgeous explanation. Thanks.
@RangelRMorais
@RangelRMorais 11 ай бұрын
Nice HTML you got inside this tags.
@SamRussell-NL
@SamRussell-NL Жыл бұрын
great post, wasn't aware of this. also, I'm concerned about your second guitar leaning on the stand.. too many headstocks have broken that way (once to me!) so please be careful! haha
@stevenng1040
@stevenng1040 Жыл бұрын
As usual, super fuseful!! Thanks!
@PabloHarguindey
@PabloHarguindey Жыл бұрын
Nice job! And a new subscriptor for you
@Jacobychye
@Jacobychye 3 ай бұрын
thanks a lot for that! helped a lot
@sofaking6642
@sofaking6642 Жыл бұрын
This is really great man!
@devkasunlakshitha
@devkasunlakshitha Жыл бұрын
Thank you so much for the tip
@DiogoLScarmagnani
@DiogoLScarmagnani 11 ай бұрын
I figured out dialog element a few months ago and I got very astonished! This is a very good tool to make modals. I only got sad with the fact of that it is not possible natively to close the modal by clicking outside it (clicking in the ::background space), and although they recommend the getBoundingClienteRect() function, it doesn't work correctly when your modal has border-radius and you click on that specifcly space. But I think it's going to get better in the future.
@mkman
@mkman Жыл бұрын
Awesome video, thanks Kyle!
@user-fed-yum
@user-fed-yum Жыл бұрын
You never cease to amaze Kyle.
@danilo_teixeira
@danilo_teixeira 10 ай бұрын
Dude, best channel ever! Kudos!!
@augustoeduardo209
@augustoeduardo209 Жыл бұрын
Thank you, my projects are now tab safe.
@D7460N
@D7460N Жыл бұрын
Thanks so much for this! Is there no way to open/close the modal with its full functionality in pure CSS?
@Dream-Web
@Dream-Web 2 ай бұрын
This element is really amazing. We all remember having spent hours to just implement this which can never be as good as what we can get with . I have a small tip for you- in the close modal example for forms, you must keep the submit button first because they have also made dailog input to automatically click the first button on the form when you press enter & we want that behaviour to be submit!
@_HMCB_
@_HMCB_ 11 ай бұрын
First time viewer. Great stuff. This channel is an easy subscribe.
@kennethbeal
@kennethbeal Жыл бұрын
Thank you! You remind me of the guy from Let's Get Rusty, Bogdan I think. Great presentation; thanks again!
@sleighterror
@sleighterror 6 ай бұрын
Thanks for this and the YT algorithm for showing it to me at the right time (even if it creeps me out that it knows...) . This would be perfect for HTML/JS games to display dialog and menu screens.
@luckysbackupchannel
@luckysbackupchannel Жыл бұрын
I'm not gonna lie. I had to look into this and it's been supported for quite a while. How has this not been the top response for anytime someone is asking on how to make modals/dialogues?
@Daijyobanai
@Daijyobanai Жыл бұрын
Because everyone is obsessed with creating custom elements instead of using web standards. HTML covers so much, yet we keep reinventing the wheel.
@luckysbackupchannel
@luckysbackupchannel Жыл бұрын
@@Daijyobanai I can see that. It’s a shame because the same thing can be accomplished in less code. I honestly dont get it :/
@Linxflasher
@Linxflasher 11 ай бұрын
Thanks for the video, Kyle! These features should have been implemented a long time ago. At least it's good that we have them now. But that backdrop moment, being unable to close on click, is still disappointing 😄I hope they will provide us a way to close modal by clicking on the backdrop, because it's quite a common feature.
@robertn2997
@robertn2997 Жыл бұрын
Looks nice and simple to use. Can you also animate the modal when is shows and close?
@AntowaKartowa
@AntowaKartowa Жыл бұрын
Seems not. Tried to apply (.modal[open]) opacity or simply background color transition, but it didn't work. Even if it would work with appearing, it won't with disappearing anyway. To use benefits of dialog element and animate you will have to add and remove to dialog class with animation styles.
@ridass.7137
@ridass.7137 Жыл бұрын
of course not!
@rens652
@rens652 10 ай бұрын
Really nice! Will definitely be using this. There is one problem I ran into though when trying to use this in React, and i'm a bit surprised this isn't natively an option for the dialog element: usually when I build a modal I want people to be able to click away the modal by clikcing the underlay. I tried to build some solutions for this, but I ended up writing more code then if I would build a modal from scratch. Did you find any solutions for this? Cheers!
@MachiriReviews
@MachiriReviews Жыл бұрын
I will definitely be using this element in my latest project.
@Sokv90
@Sokv90 Жыл бұрын
Very useful !!! Thank you
@risj
@risj 2 ай бұрын
Awesome content! Thanks!
@ThexBorg
@ThexBorg Жыл бұрын
Great code demo dude, thanks
@justadam3186
@justadam3186 Жыл бұрын
This is game-changing! I wish stuff like this made it into HTML/CSS/JS more often
@ADubois639
@ADubois639 Жыл бұрын
You should go read the HTML docs. A lot of native elements have been introduced over the years. Dialog elements have been around for a few years already, just not widely known
@DrewLytle
@DrewLytle Жыл бұрын
The dialog element is great, but unusable really for Route based modal experiences using SSR frameworks - just the one downside to look out for. Great video!
@christianjansson6806
@christianjansson6806 Жыл бұрын
When I clicked, I was hoping this was a video showing how the world had reinstated the synchronous modal which was removed after IE 5.5, the showModalDialog(url) method... it was synchronous just like confirm(message). Confirm() can only show a text-message and return OK/Cancel, but showModalDialog() could show and return whatever you wanted. And you could have your code in one place without needing to scatter it among callback methods and global variables... But, as always - great video!
@alisherzaitov
@alisherzaitov Жыл бұрын
I hope they will do the same with a search element. HTML5 is doing great
@thedigitalceo
@thedigitalceo Жыл бұрын
This is 🔥☄️ loving this new dialog element
@rsreacts9731
@rsreacts9731 Жыл бұрын
You earns a new subscriber...🎉🎉🎉
@Imaginativeone_DF
@Imaginativeone_DF Жыл бұрын
Kyle, you are THE MAN (intended as a compliment).
@user-zg2nl3gh1o
@user-zg2nl3gh1o Жыл бұрын
Finally, something! I still don't understand why for so many years HTML doesn't have such simple features like population of or / with an array. Or even to populate a table you need to create elements or deal with strings and innerHTML
@thatanimeweirdo
@thatanimeweirdo Жыл бұрын
dynamic DOM changes is exactly why JS exists.
@zebraforceone
@zebraforceone Жыл бұрын
You're talking about logic there. HTML is simply a container, it has no concept of logic. For logic we use JS, or, to build on that you could use something like JSX.
@HBStone
@HBStone Жыл бұрын
But you *are* populating with an array... of elements. Markup is markup, the only way to represent data structures or anything else in it is with elements.
@ben_clifford
@ben_clifford 11 ай бұрын
This is going to save an old pet project that I abandoned a while back. Thanks!
@wdsenjoyer9960
@wdsenjoyer9960 Жыл бұрын
This is amazing!
@shadowysuper-coder6120
@shadowysuper-coder6120 11 ай бұрын
The dialog element adds some CSS by default, if you want to use flexbox and add display: flex to your .modal css class your modal will be visible on the page before clicking on the button. The only solution I've found is toggle a class who add display: flex when clicking on open and close buttons.... Idk if a cleaner solution exist...
@bradleyandrews2444
@bradleyandrews2444 Жыл бұрын
ngl the timing of me finding this out is perfect because i was just working on a modal for a project iam doing
@whitehoof
@whitehoof Жыл бұрын
👌👍🥳 awesome element! great news, everyone!
@dan-kn3dm
@dan-kn3dm Жыл бұрын
Nice and informative video. Only I'd change the title, since this element is not really "new", Chrome 37 already had it many years ago.
@christopheanfry2425
@christopheanfry2425 Жыл бұрын
Amazing thank you so much. I suppose it works perfectly as jsx???
@WillCate
@WillCate Жыл бұрын
Very informative, Thx
@rafa6536
@rafa6536 Жыл бұрын
Thank you! :)
@ImAMadSmiley
@ImAMadSmiley Жыл бұрын
thanks for this video !
@JamesRichardsPlays
@JamesRichardsPlays Жыл бұрын
I am not 100% sure why this is in my suggestion feed, but I am not complaining. Being a hobbyist coder and no one ever hiring me, making me use HTML on a daily basis, a lot of this is stuck in reference books and code example snippets. I wish I could keep this in my head more. I am amazed at how HTML has changed since the days in high school when I would make pages for my old GeoCities site. Things have sure changed.
@chrisfaux3769
@chrisfaux3769 Жыл бұрын
This is awesome! When do you think it will be safe to add to a production site? For now it seems safari and firefox started supporting this only recently
@HorstKirkPageKian
@HorstKirkPageKian Жыл бұрын
Great video! Regarding the cancel button: It feels weird that the cancel button still of the submit type. Would that work with type="button" as well?
@HBStone
@HBStone Жыл бұрын
I was thinking that too, or even type="reset" if you want Cancel to clear the form while closing the modal... At least I thought it was weird that both buttons saved the input, I wouldn't expect that as a site visitor.
@repenning1
@repenning1 Жыл бұрын
Nice work! If you wrap up your dialog with a promise 'return new Promise(resolve => { // dialog const dialog = document.createElement("dialog")' then you need to capture the cancel event ' dialog.addEventListener("cancel", e => { resolve("cancel") })' and finally add a call to resolve to your click event handler '...dialog.close() resolve("cancel")..."
@biswajitmohanty4467
@biswajitmohanty4467 Жыл бұрын
This is super helpful!!!
@kvazimode2
@kvazimode2 Жыл бұрын
Dope element! Didn't try, but seems like using it with react would be hard.
@bluevulpe
@bluevulpe Жыл бұрын
wow awesome dialog tag!!😮
@BorreHaugen
@BorreHaugen Жыл бұрын
Could this tag be used to make a collapsible sidebar as well?
@DeltaXML_Ltd
@DeltaXML_Ltd Жыл бұрын
Great content!
@De-Coder1.0.0
@De-Coder1.0.0 Жыл бұрын
I love this , saves a lot of time
@DanielRios549
@DanielRios549 Жыл бұрын
Very nice this dialog Element, I am having some problems to update a Modal component I have in one of the projects I'm working on, but it's normal, it's a new Element and I don't know how to use it very much.
Get started with React.js & React Router 6+
3:45:30
Academind
Рет қаралды 136 М.
ВИРУСНЫЕ ВИДЕО / Мусорка 😂
00:34
Светлый Voice
Рет қаралды 9 МЛН
PYTHON TUTORIAL PART - 6@ELC24Classes
20:22
ECL24
Рет қаралды 9
I've been challenged to a CSS BATTLE by Web Dev Simplified
42:22
Kevin Powell
Рет қаралды 946 М.
Revealing the Differences between HTML Dialogs and the Popover API
24:14
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 6 М.
How To Actually Get Hired In 2024
10:43
Web Dev Simplified
Рет қаралды 184 М.
10 Tailwind Classes I Wish I Knew Earlier
13:31
Web Dev Simplified
Рет қаралды 149 М.
React Dialogs (the right way)
15:46
Coding in Public
Рет қаралды 3,9 М.
CSS Anchor Is The Best New CSS Feature Since Flexbox
15:39
Web Dev Simplified
Рет қаралды 351 М.
How To Load Images Like A Pro
15:48
Web Dev Simplified
Рет қаралды 348 М.
21 Awesome Web Features you’re not using yet
8:31
Fireship
Рет қаралды 957 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 441 М.
ВИРУСНЫЕ ВИДЕО / Мусорка 😂
00:34
Светлый Voice
Рет қаралды 9 МЛН