Skip to content

Commit

Permalink
Fix opened TextField Date Picker at start (mobile)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-drozd-it committed Apr 24, 2024
1 parent 788b98b commit 4a951cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
},
"ignorePatterns": ["**/config.js", "vite.config.ts", "src/vite-env.d.ts"],
"rules": {
"@typescript-eslint/no-unused-vars": ["warn", { "vars": "all", "args": "after-used" }],
"@typescript-eslint/no-explicit-any": "warn",
"array-bracket-spacing": [ 2, "always", {
"objectsInArrays": true,
"arraysInArrays": true
Expand Down
4 changes: 3 additions & 1 deletion src/components/countdowntimer/CountdownTimer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
countdownTimerStartLabel, countdownTimerStopLabel,
countdownTimerEnableLabel, countdownTimerDisableLabel, countdownTimerSetLabel }
from '../translated/translatedComponents';
import { isMobileSelector } from '../../store/selectors';

const CountdownTimerDiv = styled('div')(({ theme }) => ({
display: 'flex',
Expand All @@ -17,6 +18,7 @@ const CountdownTimerDiv = styled('div')(({ theme }) => ({
}));

const CountdownTimer = () : JSX.Element => {
const isMobile = useAppSelector(isMobileSelector);
const dispatch = useAppDispatch();
const isEnabled = useAppSelector((state) => state.countdownTimer.isEnabled);
const isStarted = useAppSelector((state) => state.countdownTimer.isStarted);
Expand Down Expand Up @@ -53,7 +55,7 @@ const CountdownTimer = () : JSX.Element => {
<TextField fullWidth
aria-label={countdownTimerSetLabel()}
inputRef={inputRef}
autoFocus
autoFocus={!isMobile}
sx={{ flexGrow: '1' }}
variant='outlined'
label='timer (hh:mm:ss)'
Expand Down

0 comments on commit 4a951cd

Please sign in to comment.