mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01:00
Select input text whenever open global search command UI
This commit is contained in:
parent
551de5a37c
commit
5661729748
2 changed files with 4 additions and 0 deletions
|
@ -16,6 +16,7 @@ export default memo(function SearchCommand({ onClose = () => {} }) {
|
|||
setShowSearch(true);
|
||||
setTimeout(() => {
|
||||
searchFormRef.current?.focus?.();
|
||||
searchFormRef.current?.select?.();
|
||||
}, 0);
|
||||
},
|
||||
{
|
||||
|
|
|
@ -23,6 +23,9 @@ const SearchForm = forwardRef((props, ref) => {
|
|||
focus: () => {
|
||||
searchFieldRef.current.focus();
|
||||
},
|
||||
select: () => {
|
||||
searchFieldRef.current.select();
|
||||
},
|
||||
blur: () => {
|
||||
searchFieldRef.current.blur();
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue