Skip to content

Commit 5ac90e6

Browse files
domfarolinodbaron
andauthored
Clarify a menuitem's checked event (#1330)
Co-authored-by: L. David Baron <dbaron@chromium.org>
1 parent 36051e5 commit 5ac90e6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,18 @@ This element:
246246
* Has a `disabled` **IDL** attribute and corresponding **content** attribute.
247247
* Supports the `:enabled` and `:disabled` CSS pseudo-classes.
248248
* Events:
249-
* Either a `change` or `checked` event will be fired on checkable menu items that have their
250-
state changed. See [Issue #1321](https://github.com/openui/open-ui/issues/1321).
251249
* A `click` event is fired upon activation. See
252250
[Issue #1312](https://github.com/openui/open-ui/issues/1312). Firing a synthetic `click` here
253251
is consistent with the
254252
[HTML Standard's prose on activation](https://html.spec.whatwg.org/C#activation).
253+
* For checkable menu items,
254+
if the `click` event is not canceled (also known as `defaultPrevented`),
255+
then the following also happens synchronously after the `click` event
256+
(See [Issue #1321](https://github.com/openui/open-ui/issues/1321)):
257+
* The internal checked state changes as part of the `menuitem`'s activation behavior.
258+
* A `checked` event is fired.
259+
* Note that this happens before closing of any popovers that need to be
260+
closed as a result of activation.
255261
* Checkability:
256262
* Supports checkability, by being contained in a `<fieldset checkable=single|multiple>`.
257263
* Has a `checked` boolean **IDL** attribute that does NOT reflected any content attribute, to

0 commit comments

Comments
 (0)