mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
fixed inputs
This commit is contained in:
parent
6e89271ea9
commit
811e14fd4c
29 changed files with 566 additions and 901 deletions
|
@ -1,6 +1,6 @@
|
|||
import { useCallback, useState } from 'react';
|
||||
|
||||
export const useFocusEvent = (initialState = false) => {
|
||||
export const useFocusEvent = (initialState = false, delay = 0) => {
|
||||
const [focused, setFocused] = useState(initialState);
|
||||
|
||||
const onFocus = useCallback(
|
||||
|
@ -12,7 +12,7 @@ export const useFocusEvent = (initialState = false) => {
|
|||
},
|
||||
[setFocused]
|
||||
);
|
||||
const onBlur = useCallback(() => setTimeout(() => setFocused(false), 300), [setFocused]);
|
||||
const onBlur = useCallback(() => setTimeout(() => setFocused(false), delay), [delay]);
|
||||
|
||||
return { focused, onBlur, onFocus };
|
||||
};
|
||||
|
|
|
@ -5,7 +5,6 @@ import { getSearchResults } from '~/redux/flow/api';
|
|||
import { KeyLoader } from 'swr';
|
||||
import { INode } from '~/redux/types';
|
||||
import { GetSearchResultsRequest } from '~/redux/flow/types';
|
||||
import { COMMENTS_DISPLAY } from '~/constants/node';
|
||||
|
||||
const RESULTS_COUNT = 20;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue