fix(SearchAssembly64): streamline query update and focus handling in AQL help dialog
This commit is contained in:
parent
ddbf0d2df2
commit
be9391caec
|
|
@ -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"
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user