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:
@@ -66,6 +66,11 @@ export function TagFollowToggle({ tag }: { tag: string }) {
|
||||
<button
|
||||
type="button"
|
||||
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}
|
||||
title={error ?? (followed ? `Unfollow ${tag}` : `Follow ${tag}`)}
|
||||
aria-label={followed ? `Unfollow ${tag}` : `Follow ${tag}`}
|
||||
|
||||
Reference in New Issue
Block a user