fix(SearchAssembly64): streamline query update and focus handling in AQL help dialog

This commit is contained in:
Jaime Idolpx 2026-06-14 03:24:09 -04:00
parent ddbf0d2df2
commit be9391caec

View File

@ -590,12 +590,16 @@ export default function SearchAssembly64({ config, setConfig, onClose: _onClose
<button
key={term}
onClick={() => {
setQuery(q => {
const trimmed = q.trimEnd();
return trimmed ? `${trimmed} ${term}` : term;
});
const trimmed = query.trimEnd();
const next = trimmed ? `${trimmed} ${term}` : term;
setQuery(next);
setShowAqlHelp(false);
setTimeout(() => inputRef.current?.focus(), 50);
setTimeout(() => {
const el = inputRef.current;
if (!el) return;
el.focus();
el.setSelectionRange(next.length, next.length);
}, 50);
}}
className="w-full text-left px-4 py-3 rounded-lg border border-neutral-200 hover:bg-blue-50 hover:border-blue-300 transition-colors"
>