Skip to content

Commit ca10fb4

Browse files
authored
Merge pull request #829 from jarvis24young/fix/shift-tab-input-exclusion
fix(flow-chat): improve Shift+Tab input exclusion and remove redundant handler
2 parents 81bab7b + 29f0def commit ca10fb4

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/mobile-web/src/pages/ChatPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,9 +2419,9 @@ const ChatPage: React.FC<ChatPageProps> = ({ sessionMgr, sessionId, sessionName,
24192419
useEffect(() => {
24202420
const onKeyDown = (e: KeyboardEvent) => {
24212421
if (e.key === 'Tab' && e.shiftKey) {
2422-
// Skip when the textarea is focused — its own React handler already fired.
2423-
const tag = (e.target as HTMLElement)?.tagName;
2424-
if (tag === 'TEXTAREA') return;
2422+
const target = e.target as HTMLElement;
2423+
const tag = target?.tagName;
2424+
if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target?.isContentEditable) return;
24252425
e.preventDefault();
24262426
cycleAgentModeRef.current();
24272427
}

src/web-ui/src/flow_chat/components/ChatInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,6 @@ export const ChatInput: React.FC<ChatInputProps> = ({
20572057
e.preventDefault();
20582058
e.stopPropagation();
20592059

2060-
// Dismiss slash command if open
20612060
if (slashCommandState.isActive) {
20622061
setSlashCommandState({ isActive: false, kind: 'modes', query: '', selectedIndex: 0 });
20632062
dispatchInput({ type: 'CLEAR_VALUE' });

0 commit comments

Comments
 (0)