tyxml icon indicating copy to clipboard operation
tyxml copied to clipboard

Add support for the `popover` API and for the `name` attribute on `details` elements.

Open SylvainBoilard opened this issue 1 year ago • 3 comments

Hello,

This PR initially added support for the name attribute and specifying a toggle event handler for a details element, and was extended to implement the popover API.

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 .

See also these related PRs:

Please let me know of any issues.

Cheers,

SylvainBoilard avatar Nov 04 '24 21:11 SylvainBoilard

Thanks !

If I'm reading the spec right, toggle is a valid event for any popover element ... which can be any HTML element. In that case, ontoggle should be a global attribute.

Is that right ? Can you do the modification accordingly ?

Drup avatar Nov 08 '24 13:11 Drup

Yes that is absolutely right; I had initially planned to limit the scope of this PR to the details element but following your input I decided to update it to support the popover API.

SylvainBoilard avatar Nov 14 '24 22:11 SylvainBoilard

Hello @Drup what do you think of the new version?

balat avatar May 02 '25 09:05 balat