-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Technical review: Document <dialog> closeby attribute #39082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Technical review: Document <dialog> closeby attribute #39082
Conversation
Preview URLs
Flaws (18)URL:
URL:
URL:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for documenting this.
|
||
- `none` | ||
|
||
- : No user actions can be used to close the `<dialog>` element, only developer-specified mechanisms such as a JavaScript-powered "Close" {{htmlelement("button")}} or a {{htmlelement("form")}} submission. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful to add a few more bits here. Something like "e.g. <button onclick="dialog.close()">
". As I read this sentence, it sounded like there was some magic declarative way to make a button close the dialog.
|
||
- `any` | ||
|
||
- : The `<dialog>` element can be closed via relevant platform-specific close requests, or by pressing outside the `<dialog>`. This is equivalent to the ["light dismiss" behavior of "auto" state popovers](/en-US/docs/Web/API/Popover_API/Using#auto_state_and_light_dismiss). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word "pressing" is weird. Perhaps "clicking or tapping"?
|
||
## Examples | ||
|
||
```js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would an HTML example be good to include, perhaps first? <dialog closedby=any>
?
|
||
- `none` | ||
|
||
- : No user actions can be used to close the `<dialog>` element, only developer-specified mechanisms such as a JavaScript-powered "Close" {{htmlelement("button")}} or a {{htmlelement("form")}} submission. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above here and below.
Description
Chrome 134 supports the
closedby
attribute of the<dialog>
element: see https://chromestatus.com/feature/5097714453577728.This PR documents the new attribute, plus the equivalent DOM property.
Motivation
Additional details
Related issues and pull requests