Palette: keep focus in the search input so Enter only searches
Clicking the + follow toggle used to move focus onto that button, so the next Enter re-triggered the follow instead of searching the highlighted tag. The toggle now prevents the mouse-down focus steal, and the footer hint spells out that Enter searches while + follows.
This commit is contained in:
@@ -423,7 +423,7 @@ function CommandPaletteDialog({ onClose }: { onClose: () => void }) {
|
|||||||
<div className="flex items-center gap-3 border-t border-ctp-surface1 px-4 py-2 text-[10px] text-ctp-overlay0">
|
<div className="flex items-center gap-3 border-t border-ctp-surface1 px-4 py-2 text-[10px] text-ctp-overlay0">
|
||||||
<span className="flex items-center gap-1.5">
|
<span className="flex items-center gap-1.5">
|
||||||
<Images className="h-3 w-3 shrink-0" /> Enter searches the
|
<Images className="h-3 w-3 shrink-0" /> Enter searches the
|
||||||
highlighted tag · + follows it
|
highlighted tag — the + button only follows/unfollows
|
||||||
</span>
|
</span>
|
||||||
<span className="ml-auto font-mono">↑↓ · Esc</span>
|
<span className="ml-auto font-mono">↑↓ · Esc</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ export function TagFollowToggle({ tag }: { tag: string }) {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
|
onMouseDown={(event) => {
|
||||||
|
// Keep focus where it was (e.g. the Ctrl+K input) so a following
|
||||||
|
// Enter press searches instead of re-triggering this toggle.
|
||||||
|
event.preventDefault();
|
||||||
|
}}
|
||||||
disabled={busy || query.isPending}
|
disabled={busy || query.isPending}
|
||||||
title={error ?? (followed ? `Unfollow ${tag}` : `Follow ${tag}`)}
|
title={error ?? (followed ? `Unfollow ${tag}` : `Follow ${tag}`)}
|
||||||
aria-label={followed ? `Unfollow ${tag}` : `Follow ${tag}`}
|
aria-label={followed ? `Unfollow ${tag}` : `Follow ${tag}`}
|
||||||
|
|||||||
Reference in New Issue
Block a user