Replies: 18 comments 34 replies
-
Shouldn't this be the default? Why is it not? |
Beta Was this translation helpful? Give feedback.
-
I'm not familiar with the "light dismiss" phrase. Is there any background or links on what that means? |
Beta Was this translation helpful? Give feedback.
-
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"> |
Beta Was this translation helpful? Give feedback.
-
close-on-click-outside? |
Beta Was this translation helpful? Give feedback.
-
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.) |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Soft-dismissal? |
Beta Was this translation helpful? Give feedback.
-
onblur-close Or close-onblur |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Could you make it the default behavior, but clicking on the backdrop prevents it from closing? .dialog::backdrop {
pointer-events: none;
} |
Beta Was this translation helpful? Give feedback.
-
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) |
Beta Was this translation helpful? Give feedback.
-
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? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
I wonder about explicitly using the word "backdrop", to match the
? |
Beta Was this translation helpful? Give feedback.
-
Note that |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Based on that conversation, I've created two more polls, to replace this one: |
Beta Was this translation helpful? Give feedback.
-
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_here
to 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 ·
Beta Was this translation helpful? Give feedback.
All reactions