mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-22 05:39:20 +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);
|
setShowSearch(true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
searchFormRef.current?.focus?.();
|
searchFormRef.current?.focus?.();
|
||||||
|
searchFormRef.current?.select?.();
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,9 @@ const SearchForm = forwardRef((props, ref) => {
|
||||||
focus: () => {
|
focus: () => {
|
||||||
searchFieldRef.current.focus();
|
searchFieldRef.current.focus();
|
||||||
},
|
},
|
||||||
|
select: () => {
|
||||||
|
searchFieldRef.current.select();
|
||||||
|
},
|
||||||
blur: () => {
|
blur: () => {
|
||||||
searchFieldRef.current.blur();
|
searchFieldRef.current.blur();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue