kopia lustrzana https://github.com/cheeaun/phanpy
Select input text whenever open global search command UI
rodzic
551de5a37c
commit
5661729748
|
@ -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();
|
||||
},
|
||||
|
|
Ładowanie…
Reference in New Issue