Skip to content

Commit

Permalink
Merge branch 'main' into 175-cascade-layers-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer authored Feb 8, 2024
2 parents dbf73be + 5cae4df commit 8b90f26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Popover Attribute Polyfill Changelog

## Unreleased

- 🐛 BUGFIX: Ensure click events correctly cross out of ShadowDOM --
[#177](https://github.com/oddbird/popover-polyfill/pull/177)
- 🏠 INTERNAL: Upgrade dependencies

## 0.3.8: 2024-01-16

- 🐛 BUGFIX: Allow synthetic click events to target popovers --
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ <h1>Popover Attribute Polyfill</h1>
<button popovertarget="popover13">Click to toggle Popover 13</button>

<script type="module">
const host = document.getElementById('shadowInInvoker');
const shadowRoot = host.attachShadow({ mode: 'open' });
const shadowInInvoker = document.getElementById('shadowInInvoker');
const shadowRoot = shadowInInvoker.attachShadow({ mode: 'open' });
shadowRoot.innerHTML = `<span>Click to toggle Popover 12</span>`;
</script>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ export function apply() {
if (!(root instanceof ShadowRoot || root instanceof Document)) {
return;
}
const invoker = composedPath.find(
(el) => el.matches && el.matches('[popovertargetaction],[popovertarget]'),
const invoker = composedPath.find((el) =>
el.matches?.('[popovertargetaction],[popovertarget]'),
);
if (invoker) {
popoverTargetAttributeActivationBehavior(invoker as HTMLButtonElement);
Expand Down

0 comments on commit 8b90f26

Please sign in to comment.