fix: Keep the notification popup open while its text is selected (#2706)

This commit is contained in:
Dermot Duffy
2026-08-22 21:29:04 -07:00
committed by GitHub
parent b2f3243f3e
commit 965f2b4c9d
10 changed files with 360 additions and 16 deletions
@@ -8,6 +8,7 @@ import {
getFocusedElement,
pressKey,
pressTab,
tabUntil,
} from '../browser/dom';
import { MountedCardFactory, type MountedCard } from '../browser/mounted-card';
import {
@@ -52,17 +53,7 @@ const mountCard = async (): Promise<MountedCard> => {
const tabPastCard = async (card: MountedCard): Promise<void> => {
const bound = deepQueryAll(card.card, '*').length;
// Tabbing starts from the top of the page, so the first press is the one
// that reaches the card.
await pressTab();
for (
let press = 0;
press < bound && card.card.contains(document.activeElement);
press++
) {
await pressTab();
}
await tabUntil(() => !card.card.contains(document.activeElement), bound);
};
/**