Close a persistent rich tooltip on a second press of its trigger

The bubble is a popover="auto" and the trigger is outside it, so the press
on the trigger light-dismissed the open bubble and the click that followed
opened it again: a second press never closed it, in any engine. Found by
the new exit test. A close the browser made within 250ms is now taken for
that press, as menu.js's REOPEN_GUARD_MS does, timed from beforetoggle
because toggle is queued past the click; the morph test waits past the
guard before pressing again, as the menu tests do.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andreas Reinhold / reini
2026-09-16 20:24:13 +02:00
co-authored by Claude Opus 5
parent 6a133c2c67
commit 684d60efc8
2 changed files with 27 additions and 2 deletions
+4 -1
View File
@@ -282,8 +282,11 @@ it('keeps a rich tooltip open while its action renders the component, and opens
->assertSeeIn('#renders', '1')
->assertScript("{$persistent}.matches(':popover-open')");
// Past the reopen guard (rich-tooltip.js's REOPEN_GUARD_MS), which takes a press this soon after
// a light dismiss for the press that dismissed it, as menu.js's does.
$page->click('#outside')
->assertScript("! {$persistent}.matches(':popover-open')");
->assertScript("! {$persistent}.matches(':popover-open')")
->wait(0.3);
$page->click('@details')
->assertScript("{$persistent}.matches(':popover-open')");