Skip to content

Commit 2f32a96

Browse files
authored
Do not auto-focus search input in Mobile (#3351)
Signed-off-by: Emre Bogazliyanlioglu <emre@wormholelabs.xyz>
1 parent d589a6d commit 2f32a96

File tree

1 file changed

+4
-1
lines changed
  • wormhole-connect/src/views/v2/Bridge/AssetPicker/SearchableList

1 file changed

+4
-1
lines changed

wormhole-connect/src/views/v2/Bridge/AssetPicker/SearchableList/SearchInput.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import { useMediaQuery, useTheme } from '@mui/material';
23
import InputAdornment from '@mui/material/InputAdornment';
34
import TextField from '@mui/material/TextField';
45
import { makeStyles } from 'tss-react/mui';
@@ -33,12 +34,14 @@ type SearchInputProps = {
3334

3435
export default function SearchInput(props: SearchInputProps) {
3536
const { classes } = useStyles();
37+
const theme = useTheme();
38+
const mobile = useMediaQuery(theme.breakpoints.down('sm'));
3639

3740
return (
3841
<Box sx={{ padding: '0 16px' }}>
3942
<TextField
4043
className={classes.input}
41-
autoFocus
44+
autoFocus={!mobile}
4245
fullWidth
4346
inputProps={{
4447
style: {

0 commit comments

Comments
 (0)