Skip to content

Commit 6e28b41

Browse files
LCSGreplitLCSOGthb
authored andcommitted
Close command palette when clicking outside the input field
Add an onBlur event handler with a setTimeout to the input element in home.tsx to close the command palette after a delay. Replit-Commit-Author: Agent Replit-Commit-Session-Id: c1d98846-cdae-40ca-ba6b-5e6627cb0e74 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: bc046338-46be-431e-805c-8e30ee6428c5 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0dee41ee-c766-4573-97a4-c1ee7fa2d8bb/c1d98846-cdae-40ca-ba6b-5e6627cb0e74/FxVhWXb Replit-Helium-Checkpoint-Created: true
1 parent 348249f commit 6e28b41

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • artifacts/personal-tool-console/src/pages

artifacts/personal-tool-console/src/pages/home.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ export default function Home() {
722722
value={input}
723723
onChange={(e) => { setInput(e.target.value); setIsPaletteOpen(true); }}
724724
onFocus={() => setIsPaletteOpen(true)}
725+
onBlur={() => setTimeout(() => setIsPaletteOpen(false), 120)}
725726
onKeyDown={(e) => {
726727
if (e.key === 'Escape') { e.preventDefault(); setIsPaletteOpen(false); return; }
727728
if (e.key === 'Enter') {

0 commit comments

Comments
 (0)