Comments on: Basic Dialog Usage and Gotchas To Watch For https://frontendmasters.com/blog/basic-dialog-usage-and-gotchas-to-watch-for/ Helping Your Journey to Senior Developer Sat, 17 Feb 2024 17:06:39 +0000 hourly 1 https://wordpress.org/?v=6.5.2 By: Eric Newport https://frontendmasters.com/blog/basic-dialog-usage-and-gotchas-to-watch-for/#comment-770 Sat, 17 Feb 2024 17:06:39 +0000 https://frontendmasters.com/blog/?p=724#comment-770 There is a way to do HTML-only close buttons: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog#html-only_dialog

]]>
By: Chris Coyier https://frontendmasters.com/blog/basic-dialog-usage-and-gotchas-to-watch-for/#comment-718 Fri, 09 Feb 2024 18:09:20 +0000 https://frontendmasters.com/blog/?p=724#comment-718 In reply to Chris Calo.

Yeah you gotta pick something!

Maybe .pleaseShowTheDialogElementInAModalState() and .prettyPleaseNowShowTheElementInANonModalState() would offer the ultimately clarity.

]]>
By: Chris Calo https://frontendmasters.com/blog/basic-dialog-usage-and-gotchas-to-watch-for/#comment-717 Fri, 09 Feb 2024 17:46:46 +0000 https://frontendmasters.com/blog/?p=724#comment-717 The method showModal() should not have been named showDialog() because the word “modal” in showModal() is an adjective (as in “a modal dialog”) meaning all interaction with content outside the dialog should be prevented.

The show() method, by contrast, will display the dialog non-modally, meaning interaction with content outside the dialog is allowed.

I think the confusion comes in because many people use “modal” as a noun that’s just a synonym for “dialog.” (Or perhaps it’s merely a shortening of “modal dialog” to just “modal.”) This is confusing and should be avoided because, as described above, dialogs can be modal or non-modal.

]]>