Skip to content
TypeScript

fix(web): paste after clicking away from the composer lands in it again (#13553)

Theo Browne0c84b4289cc9
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index e33e12f4eac..079c7d97b5b 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -642,6 +642,8 @@ const TYPE_TO_FOCUS_INTERACTIVE_SELECTOR = [
'[role="switch"]',
'[role="tab"]',
].join(",");
+// Popups match only while open or closing: some stay mounted when closed,
+// such as the chat header actions menu.
const TYPE_TO_FOCUS_FLOATING_LAYER_SELECTOR = [
'[role="dialog"][aria-modal="true"]',
'[data-slot="alert-dialog-popup"]:is([data-open],[data-ending-style])',
@@ -649,11 +651,11 @@ const TYPE_TO_FOCUS_FLOATING_LAYER_SELECTOR = [
'[data-slot="dialog-popup"]:is([data-open],[data-ending-style])',
'[data-slot="sheet-popup"]:is([data-open],[data-ending-style])',
'[data-slot="sidebar"][data-mobile="true"]:is([data-open],[data-ending-style])',
- '[data-slot="menu-popup"]',
- '[data-slot="select-popup"]',
- '[data-slot="popover-popup"]',
- '[data-slot="combobox-popup"]',
- '[data-slot="autocomplete-popup"]',
+ '[data-slot="menu-popup"]:is([data-open],[data-ending-style])',
+ '[data-slot="select-popup"]:is([data-open],[data-ending-style])',
+ '[data-slot="popover-popup"]:is([data-open],[data-ending-style])',
+ '[data-slot="combobox-popup"]:is([data-open],[data-ending-style])',
+ '[data-slot="autocomplete-popup"]:is([data-open],[data-ending-style])',
].join(",");
type EnvironmentUnavailableState = {