Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): fix Touchscreen Sleep scrolling issue #12992

Merged
merged 2 commits into from
Jun 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export function TouchScreenSleep({
setCurrentOption,
}: TouchScreenSleepProps): JSX.Element {
const { t } = useTranslation(['device_settings'])
// ToDo (kj:02/06/2023) This will be replaced config value via redux
const { sleepMs } = useSelector(getOnDeviceDisplaySettings) ?? SLEEP_NEVER_MS
const dispatch = useDispatch<Dispatch>()
const screenRef = React.useRef<HTMLDivElement | null>(null)

// Note (kj:02/10/2023) value's unit is ms
const settingsButtons = [
Expand All @@ -49,8 +49,12 @@ export function TouchScreenSleep({
)
}

React.useEffect(() => {
if (screenRef.current != null) screenRef.current.scrollIntoView()
}, [])

return (
<Flex flexDirection={DIRECTION_COLUMN}>
<Flex flexDirection={DIRECTION_COLUMN} ref={screenRef}>
<ChildNavigation
header={t('touchscreen_sleep')}
onClickBack={() => setCurrentOption(null)}
Expand Down