fix: prevent scroll on token select focus (#3560)

This commit is contained in:
Zach Pomerantz 2022-03-21 11:58:49 -07:00 committed by GitHub
parent 3626dbdeec
commit 46e6c2295d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,7 +68,7 @@ export function TokenSelectDialog({ value, onSelect }: TokenSelectDialogProps) {
const baseTokens: Currency[] = [] // TODO(zzmp): Add base tokens to token list functionality
const input = useRef<HTMLInputElement>(null)
useEffect(() => input.current?.focus(), [input])
useEffect(() => input.current?.focus({ preventScroll: true }), [input])
const [options, setOptions] = useState<ElementRef<typeof TokenOptions> | null>(null)