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
+19
View File
@@ -71,6 +71,25 @@ export const releaseKey = async (key: string): Promise<void> =>
export const pressTab = async (): Promise<void> => await userEvent.tab();
/**
* Press Tab until the page reaches the state the caller is waiting for,
* reporting whether it got there. `maximumPresses` is a runaway guard rather
* than a count: a page that never reaches that state fails the caller instead
* of tabbing forever.
*/
export const tabUntil = async (
isReached: () => boolean,
maximumPresses: number,
): Promise<boolean> => {
for (let press = 0; press < maximumPresses; ++press) {
await pressTab();
if (isReached()) {
return true;
}
}
return false;
};
/**
* Click an element with a real pointer, which is the only kind that carries the
* browser's own behaviour: the press moves focus, and an element that stops the