You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,15 @@ With the module imported, you can add `commandfor` and `command` attributes to y
60
60
<dialogid="my-dialog">I'm a dialog!</dialog>
61
61
```
62
62
63
+
## Supported commands
64
+
65
+
The following built-in commands (aligned with current spec) are supported:
66
+
67
+
*`toggle-popover`/`open-popover`/`close-popover`
68
+
*`show-modal`: open a `<dialog>` element in modal mode
69
+
*`close`: close a `<dialog>` open (either in modal or non-modal mode)
70
+
*`request-close`: close a `<dialog>` but emit a `cancel` event first, allowing a user to eventually prevent it. `requestClose` is only available from Safari 18.4, the `requestClose` will be polyfilled on older browsers.
71
+
63
72
## Limitations
64
73
65
74
This polyfill does not handle the aria (e.g. `aria-expanded`) of the command button the way browsers do. You are _strongly_ encouraged to handle this state yourself, to ensure your site is accessible.
0 commit comments