mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 19:22:44 +08:00
fix: add input ref and focus search fields on toggle (#7766)
* fix: add input ref and focus search fields on toggle * refactor(proxy): remove unnecessary delay in input focus timeouts
This commit is contained in:
@@ -27,6 +27,7 @@ export type SearchState = {
|
||||
type SearchOptionState = Omit<SearchState, 'text'>
|
||||
|
||||
type SearchProps = {
|
||||
inputRef?: React.RefObject<HTMLInputElement | null>
|
||||
value?: string
|
||||
defaultValue?: string
|
||||
autoFocus?: boolean
|
||||
@@ -73,6 +74,7 @@ const useControllableState = <T,>(options: {
|
||||
}
|
||||
|
||||
export const BaseSearchBox = ({
|
||||
inputRef,
|
||||
value,
|
||||
defaultValue,
|
||||
autoFocus,
|
||||
@@ -200,6 +202,7 @@ export const BaseSearchBox = ({
|
||||
return (
|
||||
<Tooltip title={effectiveErrorMessage || ''} placement="bottom-start">
|
||||
<StyledTextField
|
||||
inputRef={inputRef}
|
||||
autoComplete="new-password"
|
||||
hiddenLabel
|
||||
fullWidth
|
||||
|
||||
Reference in New Issue
Block a user