Functional page JavaScript
5.004 KB 2.242 KB gzipAlways loaded.
Browser experiments & working notes
02 / Popover targeting
Open an internal popover from an outside button.
popovertarget="host"#panelPreparing the controls…
Automatic checks for the native property. Force fallback loads the selected adapters. Browser alone leaves them out.
Popover targets
Outside buttons use popovertarget to reach the component’s panel.
Inside an open shadow root
The outside buttons target the component. Its Reference Target identifies this native popover.
This is a manual popover: use Hide panel or the close button to dismiss it.
Try: Toggle twice, then try Show and Hide.
Repeating Show or Hide keeps the same state. This manual popover closes through Hide or its internal close button.
The adapter requires the native Popover API. Event ordering and accessibility relationships can differ from native Reference Target.
Manual popover with an internal close button.
<button id="pt-toggle" type="button" popovertarget="pt-host"
popovertargetaction="toggle">Toggle panel</button>
<rt-popover-target-demo id="pt-host" data-reference-target="pt-panel">
<template shadowrootmode="open" shadowrootreferencetarget="pt-panel">
<section id="pt-panel" popover="manual" role="dialog"
aria-labelledby="pt-panel-title">
<h2 id="pt-panel-title">The host leads here</h2>
<button id="pt-close" type="button" popovertarget="pt-panel"
autofocus
popovertargetaction="hide">Close panel</button>
</section>
</template>
</rt-popover-target-demo>
Always loaded.
Core + selected adapters.
Always-loaded and fallback files; shared files counted once.
Includes 0.989 KB (0.538 KB gzip) of behavioral probes requested only after the property surface is present.
Minified / gzip. 1 KB = 1,000 bytes. Demo-only syntax highlighting is excluded from the functional totals and reported separately below.
Generated markup, including these measurements.
Styles, icon, and the highlighting scheduler; functional JS is separate above.
Document + functional fallback path + initial supporting assets, with unique files counted once.
Engine, theme, and this page’s grammar closure, requested after a source disclosure opens or during idle time.
“Local transfer” matches the included development server: gzip JavaScript sidecars, but uncompressed HTML, CSS, and SVG. GitHub Pages, browser caching, HTTP headers, and production compression can change transferred bytes and request scheduling. Module preloads fetch functional modules early without evaluating the app and do not add duplicate transfers.
Selected adapters: popover-targets.
Gzip totals sum each compressed file. The fallback and native-probe routes are mutually exclusive. Separate CSS files, HTML, JSON, source maps, HTTP headers, and Microlighter assets are excluded. Component styles embedded in JavaScript are included. Transfer sizes depend on compression and caching. Microlighter MIT license.
| File | Delivery | Minified | Gzip |
|---|---|---|---|
popover-targets/main.js |
Page | 3.257 KB | 1.352 KB |
shared/chunks/app-CP7YFVEN.js |
Page | 1.605 KB | 0.752 KB |
shared/chunks/chunk-CLCOZ6O7.js |
Fallback / native probe shared | 0.849 KB | 0.422 KB |
shared/chunks/chunk-S2QLMWTP.js |
Page | 0.142 KB | 0.138 KB |
shared/chunks/detect-X6QVIAY4.js |
Native-surface probe | 0.140 KB | 0.116 KB |
shared/chunks/reference-target.setup-Z6ZTKSGX.js |
Fallback additional | 18.142 KB | 6.469 KB |
Requires the browser’s Popover API. Event paths and automatic accessibility relationships may differ from native forwarding.
Readouts describe DOM state. Check computed names, keyboard behavior and assistive technology separately.