chore: goto anything mouse keyboard interaction (#23805)

This commit is contained in:
cathy
2025-08-12 18:17:19 +08:00
committed by GitHub
parent cb46726fa4
commit c7f36d1a5a
2 changed files with 3 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ const CommandSelector: FC<Props> = ({ actions, onCommandSelect, searchFilter, co
className="flex cursor-pointer items-center rounded-md className="flex cursor-pointer items-center rounded-md
p-2.5 p-2.5
transition-all transition-all
duration-150 hover:bg-state-base-hover aria-[selected=true]:bg-state-base-hover" duration-150 hover:bg-state-base-hover-alt aria-[selected=true]:bg-state-base-hover"
onSelect={() => onCommandSelect(action.shortcut)} onSelect={() => onCommandSelect(action.shortcut)}
> >
<span className="min-w-[4.5rem] text-left font-mono text-xs text-text-tertiary"> <span className="min-w-[4.5rem] text-left font-mono text-xs text-text-tertiary">

View File

@@ -245,6 +245,7 @@ const GotoAnything: FC<Props> = ({
className='outline-none' className='outline-none'
value={cmdVal} value={cmdVal}
onValueChange={setCmdVal} onValueChange={setCmdVal}
disablePointerSelection
> >
<div className='flex items-center gap-3 border-b border-divider-subtle bg-components-panel-bg-blur px-4 py-3'> <div className='flex items-center gap-3 border-b border-divider-subtle bg-components-panel-bg-blur px-4 py-3'>
<RiSearchLine className='h-4 w-4 text-text-quaternary' /> <RiSearchLine className='h-4 w-4 text-text-quaternary' />
@@ -322,7 +323,7 @@ const GotoAnything: FC<Props> = ({
<Command.Item <Command.Item
key={`${result.type}-${result.id}`} key={`${result.type}-${result.id}`}
value={result.title} value={result.title}
className='flex cursor-pointer items-center gap-3 rounded-md p-3 will-change-[background-color] aria-[selected=true]:bg-state-base-hover data-[selected=true]:bg-state-base-hover' className='flex cursor-pointer items-center gap-3 rounded-md p-3 will-change-[background-color] hover:bg-state-base-hover-alt aria-[selected=true]:bg-state-base-hover data-[selected=true]:bg-state-base-hover'
onSelect={() => handleNavigate(result)} onSelect={() => handleNavigate(result)}
> >
{result.icon} {result.icon}