Skip to content

Commit 9d4ad04

Browse files
authored
Move request-close command to the graduated command list (#1174)
1 parent daa1d9f commit 9d4ad04

File tree

2 files changed

+1
-63
lines changed

2 files changed

+1
-63
lines changed

site/src/pages/components/future-invokers.explainer.mdx

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ interactivity, and how the button may need to respond to such actions.
3030

3131
| Invokee Element | `command` hint | Behaviour |
3232
| :-------------------- | :--------------------- | :------------------------------------------------------------------------------------------------------------- |
33-
| `<dialog>` | `'request-close'` | If the `<dialog>` is `open`, request to close and use the button `value` for returnValue. Similar to `.requestClose(value) |
3433
| `<* openable>` | `'toggle-openable'` | Opens the `openable` if closed, otherwise closes. Similar to `.toggleOpenable()` |
3534
| `<* openable>` | `'close-openable'` | Closes the `openable` if open, otherwise does nothing. Similar to `.closeOpenable()` |
3635
| `<* openable>` | `'open-openable'` | Opens the `openable` if closed, otherwise does nothing. Similar to `.openOpenable()` |
3736
| `<details>` | `'toggle'` | If the `<details>` is `open`, then close it, otherwise open it |
3837
| `<details>` | `'open'` | If the `<details>` is not `open`, then open it |
3938
| `<details>` | `'close'` | If the `<details>` is `open`, then close it |
40-
| `<dialog>` | `'toggle'` | If the `<dialog>` is `open`, then close it and use the button `value` for returnValue, otherwise open as modal |
4139
| `<select>` | `'show-picker'` | Shows the native picker. Similar to `.showPicker()` on the invokee |
4240
| `<input>` | `'show-picker'` | Shows the native picker. Similar to `.showPicker()` on the invokee |
4341
| `<video>` | `'play-pause'` | If the video is not playing, plays the video. Otherwise pauses it. Similar to `el.playing = !el.playing` |
@@ -73,67 +71,6 @@ while (for simplicity) this section refers to various `aria-` attributes,
7371
buttons will not sprout these attributes in the DOM, but the effective
7472
equivalent will be exposed to Assistive Technologies.
7573

76-
#### Buttons with `command=request-close`
77-
78-
Buttons with this dialog command will implicitly receive `aria-details=IDREF`,
79-
where `IDREF` matches that of the `commandfor` attribute, while the dialog is
80-
in the showing state, and the button is not a descendant of the dialog.
81-
82-
<details>
83-
<summary>Why?</summary>
84-
85-
A button that cancels a dialog is very typically found inside of the dialog, but
86-
in some cases it may be found outside, perhaps as a "toggle" style button which
87-
opens and closes a dialog as non-modal. This button may be used to close an open
88-
dialog that is shown as non-modal. It may be useful for a user to traverse into
89-
the dialog before closing it, for example to check if they have unsaved changes
90-
within the dialog.
91-
92-
</details>
93-
94-
<br/><br/>
95-
96-
Buttons will also implicitly receive an `aria-expanded` value, if they are not a
97-
descendant of the `commandfor=` referenced element. The state of the
98-
`aria-expanded` value will map to the state of the dialog's openness. When the
99-
dialog is open the button will have `aria-expanded="true"`, when closed,
100-
`aria-expanded="false"`. This will be recomputed whenever the dialog changes
101-
state, such that the button always reflects the state of openness.
102-
103-
<details>
104-
<summary>Why?</summary>
105-
106-
A button that cancels a dialog is very typically found inside of the dialog, but
107-
in some cases it may be found outside, perhaps as a "toggle" style button which
108-
opens and closes a dialog as non-modal.
109-
110-
Buttons outside of the dialog may be used to close an open dialog that is shown
111-
as non-modal. It may be useful for a user to traverse into the dialog before
112-
closing it, for example to check if they have unsaved changes within the dialog.
113-
It may also be useful to know if the dialog is already closed (as in its
114-
`aria-expanded` state is false), as this may help the user make a decision to
115-
whether or not they action the close button.
116-
117-
</details>
118-
119-
<br/><br/>
120-
121-
<details>
122-
<summary>Other considerations not explicitly proposed.</summary>
123-
124-
##### aria-pressed
125-
126-
Given elements will have `aria-expanded`, adding `aria-pressed` would be
127-
confusing or redundant, and as such won't be proposed for these buttons.
128-
129-
##### aria-controls
130-
131-
While `aria-controls` attempts to establish a similar style of relationship to
132-
`aria-details`, `aria-details` sees broader support among various assistive
133-
technologies, and it would be redundant to add both.
134-
135-
</details>
136-
13774
<br/><br/>
13875

13976
#### Other built-in `command=` types

site/src/pages/components/invokers.explainer.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ When the `command` attribute is missing it will default to an invalid state.
230230
| `<* popover>` | `'show-popover'` | Shows the `popover` if closed, otherwise does nothing. Similar to `.showPopover()` |
231231
| `<dialog>` | `'show-modal'` | If the `<dialog>` is not `open`, shows it as modal. Similar to `.showModal()` |
232232
| `<dialog>` | `'close'` | If the `<dialog>` is `open`, close and use the button `value` for returnValue. Similar to `.close(value) |
233+
| `<dialog>` | `'request-close'` | If the `<dialog>` is `open`, request to close and use the button `value` for returnValue. Similar to `.requestClose(value) |
233234

234235
### Accessibility
235236

0 commit comments

Comments
 (0)