-
Notifications
You must be signed in to change notification settings - Fork 64
Add support for the popover API and for the name attribute on details elements.
#341
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: master
Are you sure you want to change the base?
Conversation
|
Thanks ! If I'm reading the spec right, Is that right ? Can you do the modification accordingly ? |
7ded376 to
39a391f
Compare
name and ontoggle attributes for details HTML elements.|
Yes that is absolutely right; I had initially planned to limit the scope of this PR to the |
popover API and for the name attribute on details elements.
39a391f to
48365f4
Compare
…etails>` elements. See: - https://html.spec.whatwg.org/multipage/popover.html ; - https://html.spec.whatwg.org/multipage/indices.html#event-toggle ; - https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element ; - https://developer.mozilla.org/en-US/docs/Web/API/Popover_API - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#events ; - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#attributes .
|
Hello @Drup what do you think of the new version? |
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.
Pull request overview
This PR adds comprehensive support for the modern HTML Popover API and extends the details element with the name attribute, enabling named exclusive accordions. The implementation follows HTML specification and is consistent with existing library patterns.
Key Changes:
- Implements the Popover API with
popover,popovertarget, andpopovertargetactionattributes - Adds
nameattribute todetailselements for exclusive accordion groups - Introduces
toggleandbeforetoggleevent handlers for popover and details state changes
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/html_types.mli | Defines type signatures for new popover attributes (Popover, Popovertarget, Popovertargetaction), events (OnBeforeToggle, OnToggle), and extends details_attrib with Name; adds new variants (Manual, Hide, Show, Toggle) to big_variant |
| lib/html_sigs.mli | Declares function signatures for event handlers (a_onbeforetoggle, a_ontoggle) and attribute constructors (a_popover, a_popovertarget, a_popovertargetaction) |
| lib/html_f.ml | Implements event handlers and attribute constructors using existing library primitives; extends string_of_big_variant to convert new variant values to HTML-compliant strings |
| CHANGES.md | Documents the addition of popover API support and details name attribute |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hello,
This PR initially added support for the
nameattribute and specifying atoggleevent handler for adetailselement, and was extended to implement thepopoverAPI.See:
See also these related PRs:
Please let me know of any issues.
Cheers,