Repository navigation
Replies: 18 comments 34 replies
|
Shouldn't this be the default? Why is it not? |
|
I'm not familiar with the "light dismiss" phrase. Is there any background or links on what that means? |
|
In design systems I've always seen clicks like this referred to as "outside clicks" for all sorts of popover elements. I feel like that makes more sense than "light". Also if there are ever any future options here, I'd rather they be exposed as a list: <dialog closetrigger="outside delay blur etc"> |
|
close-on-click-outside? |
|
In Cocoa this property is called “transient”. See https://developer.apple.com/documentation/appkit/nspopover/behavior/transient <dialog transient> Tap the background to close me. </dialog>I like @jamiebuilds idea of it being extensible so this attribute could also support a string value. <dialog transient="outside blur etc"> Focus anything else to close me. </dialog>(Btw I’m not a fan of the term “light close” because it sounds like it could be referring to the light DOM.) |
|
|
|
|
|
Soft-dismissal? |
|
onblur-close Or close-onblur |
|
|
|
Could you make it the default behavior, but clicking on the backdrop prevents it from closing? .dialog::backdrop {
pointer-events: none;
} |
|
Android flips the default (click outside closes by default), but they have a setCanceledOnTouchOutside() https://developer.android.com/reference/android/app/Dialog#setCanceledOnTouchOutside(boolean) I think it's interesting that they use the cancel rather than close terminology here. @mfreed7 am I correct in thinking this behaviour would trigger a cancel even like escape and back gesture do currently? If so is it worth considering using the cancel term instead of close? (Not overly fussed just thought it was interesting) |
I was thinking this new behavior would trigger a close, not a cancel, but I don't have strong opinions. @domenic you have a better understanding of close vs. cancel, and stronger opinions about the naming. What do you think? |
|
So with 47 votes at this point, the winner with 27% is... Looks like perhaps I need to collect some of the many suggestions made in comments here and run another survey? Some of the interesting ones include:
Note that I skipped ones that have "dismiss" in them due to #834 (comment), and those that try to specify the particular mechanisms to light dismiss (e.g. click vs. blur) due to #834 (comment). @domenic you have strong opinions that "dismiss" should not be in the name. Do you have issues with unrelated words like |
|
I wonder about explicitly using the word "backdrop", to match the
? |
|
Note that |
|
FYI, this conversation seems to have moved to whatwg/html#9373. I guess we'll pick it up there. It's too bad it's happening in two places. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There's a desire to add an attribute on
<dialog>that adds "light dismiss" behavior to the dialog. The proposal is to add that via an attribute:<dialog attribute_name_here> I'm a light dismiss dialog </dialog>Adding
attribute_name_hereto the makes the dialog get closed (as if dialog.close() were called) when the user "light dismisses" it, e.g. by clicking outside the bounds of the dialog.Note: "Esc" key handling is separate to this light dismiss behaviour.
52 votes ·
All reactions