pantoken / formats/interactions/src / initCloseButton
Function: initCloseButton()
initCloseButton(
btn):void
Wire a close button to dismiss its target.
Target resolution (first match wins):
data-close-target="id"— dismiss the element with that idpopovertarget/commandfor— skip; native browser handles it- walk up to the nearest
<dialog>,[popover], or[data-dismissible]
Dismiss strategy:
<dialog>→dialog.close()[popover]→el.hidePopover()[data-dismissible]or[open]→ remove open attr + fire bubblingclose
Parameters
btn
HTMLElement
Returns
void