Skip to content

Commit

Permalink
Move hide event before state changes on :open
Browse files Browse the repository at this point in the history
Move the timing of the popover `popoverhide` event a bit earlier
in the process, just *before* the state changes to "transitioning".
This has the effect of making the state clean (either :open or
:closed) for both `popoverhide` and `popovershow`.

See the discussion here:
openui/open-ui#607

Bug: 1307772
Change-Id: I5aaabfd48204e54831ce435c71a54e692e139caf
  • Loading branch information
mfreed7 authored and chromium-wpt-export-bot committed Nov 18, 2022
1 parent dbcd308 commit daf6651
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions html/semantics/popovers/popover-events.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@
assert_false(popover.hasAttribute('onpopoverhide'));
t.add_cleanup(() => popover.removeAttribute('onpopovershow'));
t.add_cleanup(() => popover.removeAttribute('onpopoverhide'));
popover.onpopovershow = () => ++showCount;
popover.onpopoverhide = () => ++hideCount;
popover.onpopovershow = (p) => {
assert_true(p.matches(':closed'),'The popover should be in the :closed state when the popovershow event fires.');
++showCount;
};
popover.onpopoverhide = () => {
assert_true(p.matches(':open'),'The popover should be in the :open state when the popoverhide event fires.');
++hideCount;
};
break;
default: assert_unreached();
}
Expand Down

0 comments on commit daf6651

Please sign in to comment.