We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3606633 commit 66102abCopy full SHA for 66102ab
src/Provider.tsx
@@ -1,6 +1,6 @@
1
import React, {
2
useCallback,
3
- useEffect,
+ useLayoutEffect,
4
useMemo,
5
useState,
6
type PropsWithChildren,
@@ -136,9 +136,10 @@ export function useFormSmartScroll({
136
137
const currentFocus = useAtomValue(currentFocusAtom);
138
139
- useEffect(() => {
+ // we have a flick on first focus so we make the scrollview wait a bit before animate
140
+ useLayoutEffect(() => {
141
if (currentFocus && !isReady) {
- setTimeout(() => setIsReady(true), 100);
142
+ setTimeout(() => setIsReady(true), isAndroid ? 250 : 100);
143
}
144
}, [currentFocus]);
145
0 commit comments