fix(web): preserve search focus behavior
This commit is contained in:
+4
-2
@@ -1619,6 +1619,7 @@ export default function App() {
|
||||
|
||||
useEffect(() => {
|
||||
if (isActiveSelectionSending) return;
|
||||
if (isSearchMode) return;
|
||||
const hasWorkspaceSelection = Boolean(selectedItem) || draftKind !== null;
|
||||
if (!hasWorkspaceSelection) return;
|
||||
const mobileLayout = isMobileLayout();
|
||||
@@ -1628,7 +1629,7 @@ export default function App() {
|
||||
}
|
||||
suppressNextMobileComposerFocusRef.current = false;
|
||||
focusComposer();
|
||||
}, [draftKind, isActiveSelectionSending, selectedKey]);
|
||||
}, [draftKind, isActiveSelectionSending, isSearchMode, selectedKey]);
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
@@ -1927,6 +1928,7 @@ export default function App() {
|
||||
setIsChatSettingsOpen(false);
|
||||
setChatSettingsError(null);
|
||||
setIsMobileSidebarOpen(false);
|
||||
focusComposer();
|
||||
};
|
||||
|
||||
const selectAdjacentSidebarItem = (direction: -1 | 1) => {
|
||||
@@ -3448,7 +3450,7 @@ export default function App() {
|
||||
}
|
||||
} finally {
|
||||
const shouldSuppressMobileChatFocus = sentTarget?.kind === "chat" && isMobileLayout();
|
||||
if ((!sentTarget || isCurrentSelection(sentTarget)) && !shouldSuppressMobileChatFocus) {
|
||||
if ((!sentTarget || isCurrentSelection(sentTarget)) && !sentAsSearch && !shouldSuppressMobileChatFocus) {
|
||||
focusComposer();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user