Live data from Hacker News

: The Dialog Element

developer.mozilla.org

21–30 of 160 posts

Re: <dialog>: The Dialog Element

#21
post #3

Why is this on the front page? It is nothing special

It doesn’t have to be brand new to be on the front page. Good ol’ or reference content is suitable too.

For instance, see this recent thread https://news.ycombinator.com/item?id=41967897 about the “418 I’m a teapot” HTTP status code, also linking to MDN. It was nothing new neither.

Re: <dialog>: The Dialog Element

#22
post #2

See my article "The HTML dialog element API is a mess": https://lapcatsoftware.com/articles/2024/2/1.html

I don't think anyone would say web-standards are excellent, well designed and well-managed.

All the wonderful value is in that they are standard. The web is great in its ubiquity. Love the web! Sure it's a mess, how could it not be?!

is a win here in my view, especially for internal admin tools, I don't want to care about the latest flavor of frontend insanity. I just want to save screen space and open content as modal overlay on top of a main view.

Re: <dialog>: The Dialog Element

#23
post #22
post #2

See my article "The HTML dialog element API is a mess": https://lapcatsoftware.com/articles/2024/2/1.html

I don't think anyone would say web-standards are excellent, well designed and well-managed. All the wonderful value is in that they are standard. The web is great in its ubiquity. Love the web! Sure it's a mess, how could it not be?! is a win here in my view, especially for internal admin tools, I don't want to care about the latest flavor of frontend insanity. I just want to save screen space and open content as mod…

It isn't wonderful though, it's mediocre :)

They should err on the side of keeping the APIs small. Maybe it would be better if Web Components weren't a thing. I thought ARIA was handling dialogs well when it comes to accessibility. I like the idea of splitting JavaScript into JSSugar and JS0. (It will be nice if in the Deno lawsuit that the USPTO clarifies that Oracle owns the term JavaScript and JS is a free-for-all.)

Re: <dialog>: The Dialog Element

#24

Tried this today and came across an issue that I could not get around: if the dialog contains a form, then submitting the form with enter (focused on any input) or space (focused on the submit button) will close the dialog. I couldn't find any nice way of preventing it. Normally a form will reload the page anyways so I guess this isn't a normal problem but I was using htmx.

Your last sentence is likely right, by default the form issues a network request.

I've been using a dialog form to update an iframe (it's an editor) so it does work as normal the target iframe gets reloaded. It does not close the dialog though.

I can't produce the case where hitting enter closes the dialog. It should be the same as `submit` which also does not close the dialog.

FWIW I learned yesterday that a button _can_ close the dialog:

    Update & Close

Re: <dialog>: The Dialog Element

#25
post #2

See my article "The HTML dialog element API is a mess": https://lapcatsoftware.com/articles/2024/2/1.html

There's more where that came from. Google Chrome also did URLPattern, which I hope Chrome and Safari will hold firm on not supporting. The compression streams API wasn't bad, but it's a tiny API. I see a pattern here: Google sucks at UX and DX.

Edit: I looked up standards positions and both support URLPattern.

Re: <dialog>: The Dialog Element

#26
post #15

Earlier quoted context omitted.

This is a feature

Yes, but that can be surprising. That you cannot adjust the z-index is disturbing, especially given that you have to style yourself if you wanna make it look any good (as others have reported here). Also, for the record, alert() is still higher than on the plane (see https://i.imgur.com/tzKOEF2.png ).

FWIW, it's on a separate layer that's not affected by z-index:

https://developer.mozilla.org/en-US/docs/Glossary/Top_layer

Re: <dialog>: The Dialog Element

#27
post #2

See my article "The HTML dialog element API is a mess": https://lapcatsoftware.com/articles/2024/2/1.html

There's more where that came from. Google Chrome also did URLPattern, which I hope Chrome and Safari will hold firm on not supporting. The compression streams API wasn't bad, but it's a tiny API. I see a pattern here: Google sucks at UX and DX. Edit: I looked up standards positions and both support URLPattern.

> There's more where that came from. Google Chrome also did URLPattern, which I hope Chrome and Safari will hold firm on not supporting.

Did you mean Firefox and Safari? Anyway, WebKit appears to be adding support for URLPattern.

Re: <dialog>: The Dialog Element

#28

I started using in 2019, even though Firefox and Safari wouldn't support it for another couple of years, but Google's own Polyfill (of which I am a very modest contributor) was top-notch quality and so I had no problems using it in production for my LoB SaaS day-job. But my biggest let-down with the element is that it's comnpletely unstyled, beyond a very basic (and very un-Chrome-like) thick black line pixel border…

Most websites have their own style they apply everywhere and would probably appreciate how styleable dialog is. Maybe a way to easily apply/remove default styles could satisfy everyone.

Re: <dialog>: The Dialog Element

#30
post #27

Earlier quoted context omitted.

There's more where that came from. Google Chrome also did URLPattern, which I hope Chrome and Safari will hold firm on not supporting. The compression streams API wasn't bad, but it's a tiny API. I see a pattern here: Google sucks at UX and DX. Edit: I looked up standards positions and both support URLPattern.

> There's more where that came from. Google Chrome also did URLPattern, which I hope Chrome and Safari will hold firm on not supporting. Did you mean Firefox and Safari? Anyway, WebKit appears to be adding support for URLPattern.

I did, and looked it up and Firefox chose the support position for it as well. I looked at the API again and I guess it's all right. It doesn't help much with tree-based routing like Roda (https://roda.jeremyevans.net/index.html) but it seems useful for simple stuff.
Post reply on HN