Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): right-panel launcher letters work while a closed menu stays mounted #18132

Mergedmacodev00(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/18132/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 42 additions and 11 deletions.

x
0 of 2 viewed, 2 left
30 additions and 2 deletionsapps/web/src/components/RightPanelTabs.keyboard.browser.test.tsxModified
View file
@@ -137,6 +137,28 @@
​
+ it("opens Files while a closed popup remains mounted", async () => {
+ await renderPanel();
+ const popup = document.createElement("div");
+ popup.dataset.slot = "menu-popup";
+ popup.dataset.closed = "";
+ container.append(popup);
+​
+ expect((await press("f")).defaultPrevented).toBe(true);
+ expect(addFiles).toHaveBeenCalledOnce();
+ });
+​
+ it("opens the add-surface menu while a closed popup remains mounted", async () => {
+ await renderPanel();
+ const popup = document.createElement("div");
+ popup.dataset.slot = "menu-popup";
+ popup.dataset.closed = "";
+ container.append(popup);
+​
+ expect((await press("t", { metaKey: true })).defaultPrevented).toBe(true);
+ expect(document.querySelector('[role="menu"]:not([data-closed])')).not.toBeNull();
+ });
+​
it("leaves the shortcut alone while the mounted panel is closed", async () => {
await renderPanel({ open: false });
expect((await press("t", { metaKey: true })).defaultPrevented).toBe(false);