Earlier quoted context omitted.
So a few years ago I went into my chrome configuration and added a new custom "Site Search". It's shortcut is "mdn" and the URL is " https://developer.mozilla.org/en-US/search?q=%s&w=3&qs=plugi... " Now you can just "mdn " in your omnibar and it will take you straight to the subject page or to a search results page. I find this shortcut invaluable when developing for the web.
very helpful link, thanks! I don't know what ominibar is (maybe Mac stuff), but I'm on Linux, but I replaced the "q=%s" with my string and it works. nice!
: The Dialog Element
131–140 of 160 posts
Re: <dialog>: The Dialog Element
#132Earlier quoted context omitted.
All of which these days are going to be unused in favor of some toolkit, because they don't behave predictably enough across browsers / browser versions.
Except file, no one is giving the browser full access to their files so that it can render a shitty file picker
Re: <dialog>: The Dialog Element
#133See my article "The HTML dialog element API is a mess": https://lapcatsoftware.com/articles/2024/2/1.html
Re: <dialog>: The Dialog Element
#134Earlier quoted context omitted.
For a company that had a giant 30 minute wizard in the web interface, I wrote a wizard engine in VueJS that works similarly. It's served hundreds of thousands of users since 2019 and went through medical device certification :) Took me quite some time to realize we can use `await` to wait for user input too, not just APIs etc. I recently re-created parts of it from memory for a hobby project and just now open-sourced…
Why is it any surprise that one can use await to wait for user input? It is just promises under the hood, right? So that is exactly like one would expect a promise using dialog to work.
Re: <dialog>: The Dialog Element
#135Earlier quoted context omitted.
I also went thru a phase years ago where I also claimed all dialogs should be modeless to free up users to do "anything at any time". But the problem with "anything any time" is that your state management becomes a nightmare, because you then have to start guarding against astronomically large numbers of ways users can create invalid states, create contradictory settings, or have the content of one dialog become inva…
Why would the state management get any more difficult? Any change a user would have input into a modal dialog only gets applied when that dialog is closed/done. Same can be done for any implementation using no modal dialog. You can have a "save changes" or whatever button that confirms the changes and only then they affect the state. There seems no inherent reason that it would become more complicated.
I know people can argue endlessly that no process step should ever REQUIRE input from some other step, but that's the same as saying "There's no such thing as a multi-step process" which is obviously an incorrect statement.
Like if I'm editing a new CMS record, and adding an attachment/file to it, what if I clicked "cancel" on the new record WHILE the upload Dialog is open? Sure you can rationalize your way around that, and think your way out of how that can work with modeless dialogs, but you're just creating lots of unnecessary work for yourself if you do.
Modal dialogs have been around literally forever (even before the web) because they're needed. It's a signal to the user that they MUST complete something before moving forward.
Re: <dialog>: The Dialog Element
#136Earlier quoted context omitted.
This is why I mainly use some other custom with a popover="" attribute. They're easily targeted with a button and no clientside JS required, and can be closed by clicking outside them, which s don't have by default. They also still have the same helpful top-layer properties. Unsure about accessibility on this front, though it can't be worse than my previous attempts with hidden labels/checkboxes/form elements, while…
Re. accessibility, the main feature is that dialogs can be "modal" - meaning the rest of the page is non-interactive while the dialog is open - ensuring a focus trap. Popovers are always non-modal, which can be problematic depending on the use-case. Of course it's possible to manually implement a focus trap, but it's complex and it's javascript.
I think it is possible to use popover to open a dialog non-modally and use progressive enhancement to replace that behavior with `.showModal()`.
Re: <dialog>: The Dialog Element
#137Earlier quoted context omitted.
> 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. preventDefault and stopPropagation?
There's no event for the dialog about to close, only an event for after the dialog closes. You can prevent default on the enter key and space key, but that obviously breaks the form ux. There is an event for the dialog about to close from pressing the escape key. No idea why it's only for closing via escape key.
https://developer.mozilla.org/en-US/docs/Learn/Forms/Sending...
Re: <dialog>: The Dialog Element
#138Normal close in most examples not working for me. Android Firefox
Could you elaborate on what you mean by "normal close in most examples"? All the examples I see come with a JS snippet to add an event listener to the close button and those work for me in Firefox for Android.
```HTML Close ```
Re: <dialog>: The Dialog Element
#139This perplexes me. Why is it not recommended? Why put it in a standard and then recommend against it? What's wrong with it? The documentation is silent.
Re: <dialog>: The Dialog Element
#140I 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…
As a user, I would absolutely not want this. I appreciate being able to know which windows actually come from my browser and which are coming from a webpage.