Skip to content

Commit

Permalink
Fix corner case invoker issue with popover nested inside invoker
Browse files Browse the repository at this point in the history
In this situation
```
<button popovertarget=foo>Activate
  <div popover id=foo>Clicking me shouldn't close me</div>
</button>
```
clicking the button properly activates the popover, however, clicking on the popover itself after that should not close the popover. It currently does because the popover click bubbles to the `<button>` and activates the invoker, which toggles the popover closed.

This fixes that case.
  • Loading branch information
mfreed7 authored Nov 22, 2024
1 parent 531d153 commit dac8ec1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -48214,8 +48214,8 @@ interface <dfn interface>HTMLInputElement</dfn> : <span>HTMLElement</span> {
<li><p>Run <var>element</var>'s <dfn>input activation behavior</dfn>, if any, and do nothing
otherwise.</p></li>

<li><p>Run the <span>popover target attribute activation behavior</span> on
<var>element</var>.</p></li>
<li><p>Run the <span>popover target attribute activation behavior</span> given <var>element</var>
and <var>event</var>'s <span data-x="concept-event-target">target</span>.</p></li>
</ol>

<p class="note">Recall that an element's <span>activation behavior</span> runs for both
Expand Down Expand Up @@ -53512,8 +53512,8 @@ interface <dfn interface>HTMLButtonElement</dfn> : <span>HTMLElement</span> {
</dl>
</li>

<li><p>Run the <span>popover target attribute activation behavior</span> given
<var>element</var>.</p></li>
<li><p>Run the <span>popover target attribute activation behavior</span> given <var>element</var>
and <var>event</var>'s <span data-x="concept-event-target">target</span>.</p></li>
</ol>

</div>
Expand Down Expand Up @@ -86382,13 +86382,18 @@ dictionary <dfn dictionary>DragEventInit</dfn> : <span>MouseEventInit</span> {
attribute, <span>limited to only known values</span>.</p>

<p>To run the <dfn>popover target attribute activation behavior</dfn> given a <code>Node</code>
<var>node</var>:</p>
<var>node</var> and a <code>Node</code> <var>eventTarget</var>:</p>

<ol>
<li><p>Let <var>popover</var> be <var>node</var>'s <span>popover target element</span>.</p></li>

<li><p>If <var>popover</var> is null, then return.</p></li>

<li><p>If <var>eventTarget</var> is a <span>shadow-including inclusive descendant</span> of
<var>popover</var> and <var>popover</var> is a
<span data-x="shadow-including descendant">shadow-including descendant</span> of <var>node</var>,
then return.</p></li>

<li><p>If <var>node</var>'s <code data-x="attr-popovertargetaction">popovertargetaction</code>
attribute is in the <span data-x="attr-popovertargetaction-show">show</span> state and
<var>popover</var>'s <span>popover visibility state</span> is <span
Expand Down

0 comments on commit dac8ec1

Please sign in to comment.