The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 20:30 UTC
fix(mobile): iOS threads no longer jump to the top (#14808)
Noé committed
Oct 3, 2026 at 16:34 UTC
1945ce82c0d66d2b8ffbe867e688c0ecbf530e69
4 files changed
+96
-77
apps/mobile/package.json
+1
-1
@@ -114,7 +114,7 @@
114
"react-native": "0.88.0-rc.3",
115
"react-native-gesture-handler": "~3.2.1",
116
"react-native-image-viewing": "^0.2.2",
117
- "react-native-keyboard-controller": "1.22.4",
117
+ "react-native-keyboard-controller": "1.22.6",
118
"react-native-nitro-markdown": "^0.5.0",
119
"react-native-nitro-modules": "0.35.9",
120
"react-native-reanimated": "4.7.0",
patches/react-native-keyboard-controller@1.22.6.patch
renamed
+87
-68
@@ -1,8 +1,8 @@
1
diff --git a/lib/commonjs/components/KeyboardChatScrollView/index.js b/lib/commonjs/components/KeyboardChatScrollView/index.js
2
-index 5617394..4f2222a 100644
2
+index 0b78ff3..98b3b6c 100644
3
--- a/lib/commonjs/components/KeyboardChatScrollView/index.js
4
+++ b/lib/commonjs/components/KeyboardChatScrollView/index.js
5
-@@ -27,9 +27,12 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
5
+@@ -28,9 +28,12 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
6
offset = 0,
7
extraContentPadding = ZERO_CONTENT_PADDING,
8
blankSpace = ZERO_BLANK_SPACE,
@@ -15,17 +15,16 @@ index 5617394..4f2222a 100644
15
onEndVisible,
16
...rest
17
}, ref) => {
18
-@@ -51,13 +54,17 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
19
- freeze: freezeSV,
18
+@@ -54,6 +57,8 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
19
offset,
20
blankSpace,
22
-- extraContentPadding
23
-+ extraContentPadding,
21
+ extraContentPadding,
22
+ adjustedInsetCompensation,
25
-+ adjustedStartInsetCompensation
23
++ adjustedStartInsetCompensation,
24
+ initialContentOffsetY: (_rest$contentOffset = rest.contentOffset) === null || _rest$contentOffset === void 0 ? void 0 : _rest$contentOffset.y
25
});
26
(0, _useExtraContentPadding.useExtraContentPadding)({
28
- scrollViewRef,
27
+@@ -61,6 +66,8 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
28
extraContentPadding,
29
keyboardPadding: padding,
30
blankSpace,
@@ -34,19 +33,19 @@ index 5617394..4f2222a 100644
33
scroll,
34
layout,
35
size,
37
-@@ -88,10 +95,26 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
36
+@@ -91,10 +98,26 @@ const KeyboardChatScrollView = /*#__PURE__*/(0, _react.forwardRef)(({
37
// a bug for you, please open an issue.
39
- const totalPadding = (0, _reactNativeReanimated.useDerivedValue)(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
38
+ const totalPadding = (0, _reanimated.useDerivedValue)(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
39
40
+ // iOS applies the destination contentInset and contentOffset together at
41
+ // keyboard-animation start. Keep that native target behavior, but report
42
+ // the presentation height so virtualized-list layout follows the keyboard.
44
-+ const reportedPadding = (0, _reactNativeReanimated.useDerivedValue)(() => _reactNative.Platform.OS === "ios" ? Math.min(layout.value.height, Math.max(blankSpace.value, currentHeight.value + extraContentPadding.value)) : totalPadding.value);
43
++ const reportedPadding = (0, _reanimated.useDerivedValue)(() => _reactNative.Platform.OS === "ios" ? Math.min(layout.value.height, Math.max(blankSpace.value, currentHeight.value + extraContentPadding.value)) : totalPadding.value);
44
+
45
+ // Mirror the effective bottom padding (keyboard + composer + blank floor)
46
+ // to the consumer - a virtualized list needs it in its own scroll math or
47
+ // its end/maintain targets point at the under-the-keyboard resting offset.
49
-+ (0, _reactNativeReanimated.useAnimatedReaction)(() => reportedPadding.value, (current, previous) => {
48
++ (0, _reanimated.useAnimatedReaction)(() => reportedPadding.value, (current, previous) => {
49
+ if (onContentInsetChange && current !== previous) {
50
+ (0, _reactNativeReanimated.runOnJS)(onContentInsetChange)({
51
+ bottom: current
@@ -57,8 +56,8 @@ index 5617394..4f2222a 100644
56
// Scroll indicator inset = keyboard + extraContentPadding (excludes blankSpace).
57
// Apps that render into the unsafe area can supply a negative
58
// scrollIndicatorInsets adjustment at the application layer.
60
-- const indicatorPadding = (0, _reactNativeReanimated.useDerivedValue)(() => padding.value + extraContentPadding.value);
61
-+ const indicatorPadding = (0, _reactNativeReanimated.useDerivedValue)(() => padding.value);
59
+- const indicatorPadding = (0, _reanimated.useDerivedValue)(() => padding.value + extraContentPadding.value);
60
++ const indicatorPadding = (0, _reanimated.useDerivedValue)(() => padding.value);
61
const onLayout = (0, _react.useCallback)(e => {
62
onLayoutInternal(e);
63
onLayoutProp === null || onLayoutProp === void 0 || onLayoutProp(e);
@@ -89,7 +88,7 @@ index 4d33b3f..6a787d3 100644
88
//# sourceMappingURL=helpers.js.map
89
\ No newline at end of file
90
diff --git a/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js b/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
92
-index cecee07..533a9e9 100644
91
+index 6481228..0dc5dd1 100644
92
--- a/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
93
+++ b/lib/commonjs/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
94
@@ -32,7 +32,9 @@ function useChatKeyboard(scrollViewRef, options) {
@@ -188,10 +187,10 @@ index cecee07..533a9e9 100644
187
padding,
188
currentHeight,
189
diff --git a/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js b/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js
191
-index 54a1c57..00c2941 100644
190
+index 0215bef..5307446 100644
191
--- a/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js
192
+++ b/lib/commonjs/components/KeyboardChatScrollView/useExtraContentPadding/index.js
194
-@@ -31,6 +31,8 @@ function useExtraContentPadding(options) {
193
+@@ -32,6 +32,8 @@ function useExtraContentPadding(options) {
194
extraContentPadding,
195
keyboardPadding,
196
blankSpace,
@@ -200,7 +199,7 @@ index 54a1c57..00c2941 100644
199
scroll,
200
layout,
201
size,
203
-@@ -50,8 +52,13 @@ function useExtraContentPadding(options) {
202
+@@ -51,8 +53,13 @@ function useExtraContentPadding(options) {
203
// otherwise the native ScrollView clamps to the old range.
204
requestAnimationFrame(() => {
205
// check that view is still mounted and ref is actual
@@ -216,7 +215,7 @@ index 54a1c57..00c2941 100644
215
return;
216
}
217
(0, _reactNativeReanimated.scrollTo)(scrollViewRef, 0, target, false);
219
-@@ -70,8 +77,8 @@ function useExtraContentPadding(options) {
218
+@@ -71,8 +78,8 @@ function useExtraContentPadding(options) {
219
}
220
221
// Compute effective delta considering blankSpace floor
@@ -227,12 +226,15 @@ index 54a1c57..00c2941 100644
226
const effectiveDelta = currentTotal - previousTotal;
227
if (effectiveDelta === 0) {
228
// blankSpace absorbed the change
230
-@@ -90,10 +97,11 @@ function useExtraContentPadding(options) {
229
+@@ -91,13 +98,11 @@ function useExtraContentPadding(options) {
230
const target = Math.max(scroll.value - effectiveDelta, -currentTotal);
231
scrollToTarget(target);
232
} else {
233
- const maxScroll = Math.max(size.value.height - layout.value.height + currentTotal, 0);
235
-- const target = Math.min(scroll.value + effectiveDelta, maxScroll);
234
+- // Clamp at 0 as well: when the content is shorter than the viewport a
235
+- // shrinking padding makes `effectiveDelta` negative while `scroll.value`
236
+- // is already 0, so the target would go below the top of the content.
237
+- const target = Math.max(Math.min(scroll.value + effectiveDelta, maxScroll), 0);
238
+ const minScroll = -adjustedStartInsetCompensation;
239
+ const maxScroll = Math.max(size.value.height - layout.value.height + currentTotal, minScroll);
240
+ const target = Math.max(minScroll, Math.min(scroll.value + effectiveDelta, maxScroll));
@@ -244,20 +246,23 @@ index 54a1c57..00c2941 100644
246
//# sourceMappingURL=index.js.map
247
\ No newline at end of file
248
diff --git a/lib/module/components/KeyboardChatScrollView/index.js b/lib/module/components/KeyboardChatScrollView/index.js
247
-index d085394..a57c2f9 100644
249
+index e0c8391..8df802a 100644
250
--- a/lib/module/components/KeyboardChatScrollView/index.js
251
+++ b/lib/module/components/KeyboardChatScrollView/index.js
250
-@@ -1,7 +1,7 @@
252
+@@ -1,9 +1,9 @@
253
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
254
import React, { forwardRef, useCallback, useMemo } from "react";
255
-import { StyleSheet } from "react-native";
254
--import { makeMutable, useAnimatedRef, useAnimatedStyle, useDerivedValue } from "react-native-reanimated";
256
+-import { makeMutable, useAnimatedRef } from "react-native-reanimated";
257
+import { Platform, StyleSheet } from "react-native";
256
-+import { makeMutable, runOnJS, useAnimatedReaction, useAnimatedRef, useAnimatedStyle, useDerivedValue } from "react-native-reanimated";
258
++import { makeMutable, runOnJS, useAnimatedRef } from "react-native-reanimated";
259
import Reanimated from "react-native-reanimated";
260
+-import { useAnimatedStyle, useDerivedValue } from "../../reanimated";
261
++import { useAnimatedReaction, useAnimatedStyle, useDerivedValue } from "../../reanimated";
262
import useCombinedRef from "../hooks/useCombinedRef";
263
import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding";
260
-@@ -20,9 +20,12 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
264
+ import { useChatKeyboard } from "./useChatKeyboard";
265
+@@ -21,9 +21,12 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
266
offset = 0,
267
extraContentPadding = ZERO_CONTENT_PADDING,
268
blankSpace = ZERO_BLANK_SPACE,
@@ -270,17 +275,16 @@ index d085394..a57c2f9 100644
275
onEndVisible,
276
...rest
277
}, ref) => {
273
-@@ -44,13 +47,17 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
274
- freeze: freezeSV,
278
+@@ -47,6 +50,8 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
279
offset,
280
blankSpace,
277
-- extraContentPadding
278
-+ extraContentPadding,
281
+ extraContentPadding,
282
+ adjustedInsetCompensation,
280
-+ adjustedStartInsetCompensation
283
++ adjustedStartInsetCompensation,
284
+ initialContentOffsetY: (_rest$contentOffset = rest.contentOffset) === null || _rest$contentOffset === void 0 ? void 0 : _rest$contentOffset.y
285
});
286
useExtraContentPadding({
283
- scrollViewRef,
287
+@@ -54,6 +59,8 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
288
extraContentPadding,
289
keyboardPadding: padding,
290
blankSpace,
@@ -289,7 +293,7 @@ index d085394..a57c2f9 100644
293
scroll,
294
layout,
295
size,
292
-@@ -81,10 +88,26 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
296
+@@ -84,10 +91,26 @@ const KeyboardChatScrollView = /*#__PURE__*/forwardRef(({
297
// a bug for you, please open an issue.
298
const totalPadding = useDerivedValue(() => Math.min(layout.value.height, Math.max(blankSpace.value, padding.value + extraContentPadding.value)));
299
@@ -343,7 +347,7 @@ index 295e221..2f7b87e 100644
347
//# sourceMappingURL=helpers.js.map
348
\ No newline at end of file
349
diff --git a/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js b/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
346
-index 407275d..19427d7 100644
350
+index 043b973..df5a408 100644
351
--- a/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
352
+++ b/lib/module/components/KeyboardChatScrollView/useChatKeyboard/index.ios.js
353
@@ -25,7 +25,9 @@ function useChatKeyboard(scrollViewRef, options) {
@@ -442,10 +446,10 @@ index 407275d..19427d7 100644
446
padding,
447
currentHeight,
448
diff --git a/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js b/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js
445
-index 5885415..8b3c4f0 100644
449
+index 5a9b91d..a11bfdb 100644
450
--- a/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js
451
+++ b/lib/module/components/KeyboardChatScrollView/useExtraContentPadding/index.js
448
-@@ -25,6 +25,8 @@ function useExtraContentPadding(options) {
452
+@@ -26,6 +26,8 @@ function useExtraContentPadding(options) {
453
extraContentPadding,
454
keyboardPadding,
455
blankSpace,
@@ -454,7 +458,7 @@ index 5885415..8b3c4f0 100644
458
scroll,
459
layout,
460
size,
457
-@@ -44,8 +46,13 @@ function useExtraContentPadding(options) {
461
+@@ -45,8 +47,13 @@ function useExtraContentPadding(options) {
462
// otherwise the native ScrollView clamps to the old range.
463
requestAnimationFrame(() => {
464
// check that view is still mounted and ref is actual
@@ -470,7 +474,7 @@ index 5885415..8b3c4f0 100644
474
return;
475
}
476
scrollTo(scrollViewRef, 0, target, false);
473
-@@ -64,8 +71,8 @@ function useExtraContentPadding(options) {
477
+@@ -65,8 +72,8 @@ function useExtraContentPadding(options) {
478
}
479
480
// Compute effective delta considering blankSpace floor
@@ -481,12 +485,15 @@ index 5885415..8b3c4f0 100644
485
const effectiveDelta = currentTotal - previousTotal;
486
if (effectiveDelta === 0) {
487
// blankSpace absorbed the change
484
-@@ -84,11 +91,12 @@ function useExtraContentPadding(options) {
488
+@@ -85,14 +92,12 @@ function useExtraContentPadding(options) {
489
const target = Math.max(scroll.value - effectiveDelta, -currentTotal);
490
scrollToTarget(target);
491
} else {
492
- const maxScroll = Math.max(size.value.height - layout.value.height + currentTotal, 0);
489
-- const target = Math.min(scroll.value + effectiveDelta, maxScroll);
493
+- // Clamp at 0 as well: when the content is shorter than the viewport a
494
+- // shrinking padding makes `effectiveDelta` negative while `scroll.value`
495
+- // is already 0, so the target would go below the top of the content.
496
+- const target = Math.max(Math.min(scroll.value + effectiveDelta, maxScroll), 0);
497
+ const minScroll = -adjustedStartInsetCompensation;
498
+ const maxScroll = Math.max(size.value.height - layout.value.height + currentTotal, minScroll);
499
+ const target = Math.max(minScroll, Math.min(scroll.value + effectiveDelta, maxScroll));
@@ -524,10 +531,10 @@ index 2b51cc4..3acec1f 100644
531
-export declare const computeIOSContentOffset: (relativeScroll: number, keyboardHeight: number, contentHeight: number, layoutHeight: number, inverted: boolean, totalPaddingForMaxScroll?: number) => number;
532
+export declare const computeIOSContentOffset: (relativeScroll: number, keyboardHeight: number, contentHeight: number, layoutHeight: number, inverted: boolean, totalPaddingForMaxScroll?: number, startInsetCompensation?: number) => number;
533
diff --git a/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts b/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts
527
-index aff9b5a..fdd8395 100644
534
+index 8d358bc..911f3d9 100644
535
--- a/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts
536
+++ b/lib/typescript/components/KeyboardChatScrollView/useChatKeyboard/types.d.ts
530
-@@ -9,6 +9,10 @@ type UseChatKeyboardOptions = {
537
+@@ -11,6 +11,10 @@ type UseChatKeyboardOptions = {
538
blankSpace: SharedValue<number>;
539
/** Extra content padding shared value — needed on iOS to correctly clamp contentOffset. */
540
extraContentPadding: SharedValue<number>;
@@ -554,21 +561,27 @@ index ec73f70..45b3874 100644
561
scroll: SharedValue<number>;
562
/** Visible viewport dimensions. */
563
diff --git a/src/components/KeyboardChatScrollView/index.tsx b/src/components/KeyboardChatScrollView/index.tsx
557
-index 554b38c..725d546 100644
564
+index 935bc71..d411dc4 100644
565
--- a/src/components/KeyboardChatScrollView/index.tsx
566
+++ b/src/components/KeyboardChatScrollView/index.tsx
560
-@@ -1,7 +1,9 @@
567
+@@ -1,9 +1,13 @@
568
import React, { forwardRef, useCallback, useMemo } from "react";
569
-import { StyleSheet } from "react-native";
570
+-import { makeMutable, useAnimatedRef } from "react-native-reanimated";
571
+import { Platform, StyleSheet } from "react-native";
564
- import {
565
- makeMutable,
566
-+ runOnJS,
572
++import { makeMutable, runOnJS, useAnimatedRef } from "react-native-reanimated";
573
+ import Reanimated from "react-native-reanimated";
574
+
575
+-import { useAnimatedStyle, useDerivedValue } from "../../reanimated";
576
++import {
577
+ useAnimatedReaction,
568
- useAnimatedRef,
569
- useAnimatedStyle,
570
- useDerivedValue,
571
-@@ -39,9 +41,12 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
578
++ useAnimatedStyle,
579
++ useDerivedValue,
580
++} from "../../reanimated";
581
+ import useCombinedRef from "../hooks/useCombinedRef";
582
+ import ScrollViewWithBottomPadding from "../ScrollViewWithBottomPadding";
583
+
584
+@@ -35,9 +39,12 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
585
offset = 0,
586
extraContentPadding = ZERO_CONTENT_PADDING,
587
blankSpace = ZERO_BLANK_SPACE,
@@ -581,16 +594,16 @@ index 554b38c..725d546 100644
594
onEndVisible,
595
...rest
596
},
584
-@@ -68,6 +73,8 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
597
+@@ -64,6 +71,8 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
598
offset,
599
blankSpace,
600
extraContentPadding,
601
+ adjustedInsetCompensation,
602
+ adjustedStartInsetCompensation,
603
+ initialContentOffsetY: rest.contentOffset?.y,
604
});
605
592
- useExtraContentPadding({
593
-@@ -75,6 +82,8 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
606
+@@ -72,6 +81,8 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
607
extraContentPadding,
608
keyboardPadding: padding,
609
blankSpace,
@@ -599,7 +612,7 @@ index 554b38c..725d546 100644
612
scroll,
613
layout,
614
size,
602
-@@ -112,13 +121,40 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
615
+@@ -109,13 +120,40 @@ const KeyboardChatScrollView: React.ForwardRefExoticComponent<
616
),
617
);
618
@@ -697,7 +710,7 @@ index 37eacd1..3d77ab2 100644
710
+ );
711
};
712
diff --git a/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts b/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts
700
-index 129a74b..168ce1a 100644
713
+index 1ae9b81..208505b 100644
714
--- a/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts
715
+++ b/src/components/KeyboardChatScrollView/useChatKeyboard/index.ios.ts
716
@@ -43,6 +43,8 @@ function useChatKeyboard(
@@ -827,10 +840,10 @@ index 129a74b..168ce1a 100644
840
841
return {
842
diff --git a/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts b/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts
830
-index 02abf5c..4ee0ddd 100644
843
+index f89b7c8..02e0e19 100644
844
--- a/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts
845
+++ b/src/components/KeyboardChatScrollView/useChatKeyboard/types.ts
833
-@@ -11,6 +11,10 @@ type UseChatKeyboardOptions = {
846
+@@ -13,6 +13,10 @@ type UseChatKeyboardOptions = {
847
blankSpace: SharedValue<number>;
848
/** Extra content padding shared value — needed on iOS to correctly clamp contentOffset. */
849
extraContentPadding: SharedValue<number>;
@@ -842,10 +855,10 @@ index 02abf5c..4ee0ddd 100644
855
856
type UseChatKeyboardReturn = {
857
diff --git a/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts b/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts
845
-index c9c93f3..02f95c0 100644
858
+index de7d6f7..631cdfb 100644
859
--- a/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts
860
+++ b/src/components/KeyboardChatScrollView/useExtraContentPadding/index.ts
848
-@@ -16,6 +16,10 @@ type UseExtraContentPaddingOptions = {
861
+@@ -17,6 +17,10 @@ type UseExtraContentPaddingOptions = {
862
keyboardPadding: SharedValue<number>;
863
/** Minimum inset floor — used to absorb keyboard and extraContentPadding changes. */
864
blankSpace: SharedValue<number>;
@@ -856,7 +869,7 @@ index c9c93f3..02f95c0 100644
869
/** Current vertical scroll offset. */
870
scroll: SharedValue<number>;
871
/** Visible viewport dimensions. */
859
-@@ -51,6 +55,8 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
872
+@@ -52,6 +56,8 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
873
extraContentPadding,
874
keyboardPadding,
875
blankSpace,
@@ -865,7 +878,7 @@ index c9c93f3..02f95c0 100644
878
scroll,
879
layout,
880
size,
868
-@@ -72,8 +78,13 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
881
+@@ -73,8 +79,13 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
882
// otherwise the native ScrollView clamps to the old range.
883
requestAnimationFrame(() => {
884
// check that view is still mounted and ref is actual
@@ -881,7 +894,7 @@ index c9c93f3..02f95c0 100644
894
return;
895
}
896
scrollTo(scrollViewRef, 0, target, false);
884
-@@ -99,14 +110,12 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
897
+@@ -100,14 +111,12 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
898
}
899
900
// Compute effective delta considering blankSpace floor
@@ -902,7 +915,7 @@ index c9c93f3..02f95c0 100644
915
const effectiveDelta = currentTotal - previousTotal;
916
917
if (effectiveDelta === 0) {
905
-@@ -139,16 +148,25 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
918
+@@ -140,22 +149,28 @@ function useExtraContentPadding(options: UseExtraContentPaddingOptions): void {
919
920
scrollToTarget(target);
921
} else {
@@ -911,12 +924,18 @@ index c9c93f3..02f95c0 100644
924
size.value.height - layout.value.height + currentTotal,
925
- 0,
926
+ minScroll,
914
-+ );
915
-+ const target = Math.max(
927
+ );
928
+- // Clamp at 0 as well: when the content is shorter than the viewport a
929
+- // shrinking padding makes `effectiveDelta` negative while `scroll.value`
930
+- // is already 0, so the target would go below the top of the content.
931
++ // Clamp at the top as well: when the content is shorter than the
932
++ // viewport a shrinking padding makes `effectiveDelta` negative while
933
++ // `scroll.value` is already at the top.
934
+ const target = Math.max(
935
+ minScroll,
917
-+ Math.min(scroll.value + effectiveDelta, maxScroll),
936
+ Math.min(scroll.value + effectiveDelta, maxScroll),
937
+- 0,
938
);
919
-- const target = Math.min(scroll.value + effectiveDelta, maxScroll);
939
940
scrollToTarget(target);
941
}
pnpm-lock.yaml
+6
-6
@@ -111,7 +111,7 @@ patchedDependencies:
111
expo-widgets@58.0.11: 94de7964c5a67ab40e6b79d9bdf4b7bfc50ae97b70722ee8e5a35105ca83386b
112
node-pty@1.2.0-beta.15: f2fe901c61cde17986240002d05c172d5d0272d83ffaab8d0ebeb922763be414
113
react-native-gesture-handler@3.2.1: d518a937e3cb2df5e7d67f1ab6b265c74a8639e4572d1b032b7b747e9b1c01a9
114
- react-native-keyboard-controller@1.22.4: c631278492f0113f42fa8bed43c7d8ed5779424dd12af0cefc55132c2ee1d84c
114
+ react-native-keyboard-controller@1.22.6: 6e448411781347cd0b87868ee279117514a399801c18f233ddca4fa3935be75d
115
react-native-nitro-markdown@0.5.8: 642b47830730acff3761fe29cf54271d18b493c0070c750097850b7ea032e00c
116
react-native-nitro-modules@0.35.9: daf4a639ce3f951af630a3711e4082d58e3a11e5a79f45efb0b59925327ebde2
117
react-native-screens@4.28.0: cc1301436ee62c39860acc9ee1a1e60b7d47e6abd211c42effa62c056d165483
@@ -448,8 +448,8 @@ importers:
448
specifier: ^0.2.2
449
version: 0.2.2(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
450
react-native-keyboard-controller:
451
- specifier: 1.22.4
452
- version: 1.22.4(patch_hash=c631278492f0113f42fa8bed43c7d8ed5779424dd12af0cefc55132c2ee1d84c)(react-native-reanimated@4.7.0(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
451
+ specifier: 1.22.6
452
+ version: 1.22.6(patch_hash=6e448411781347cd0b87868ee279117514a399801c18f233ddca4fa3935be75d)(react-native-reanimated@4.7.0(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
453
react-native-nitro-markdown:
454
specifier: ^0.5.0
455
version: 0.5.8(patch_hash=642b47830730acff3761fe29cf54271d18b493c0070c750097850b7ea032e00c)(react-native-nitro-modules@0.35.9(patch_hash=daf4a639ce3f951af630a3711e4082d58e3a11e5a79f45efb0b59925327ebde2)(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native-svg@15.15.5(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -9561,8 +9561,8 @@ packages:
9561
react: '*'
9562
react-native: '*'
9563
9564
- react-native-keyboard-controller@1.22.4:
9565
- resolution: {integrity: sha512-2by3oJBQqKH9UAydlBeiEpivxIyTbt345bmverLym7vbEp4NXckWQLF0STnVuXYccRak5/sd3wMYDJPhv/9+3g==}
9564
+ react-native-keyboard-controller@1.22.6:
9565
+ resolution: {integrity: sha512-gwJAI3Bhbqs/Ja3uaeBz7EFQSFcem8q4wsXkrC9sy1CL14gjWhBICLu2Ecn7HmezpIu33uhLbirLGyqSawxRtg==}
9566
peerDependencies:
9567
react: '*'
9568
react-native: '*'
@@ -20049,7 +20049,7 @@ snapshots:
20049
react: 19.3.0
20050
react-native: 0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
20051
20052
- react-native-keyboard-controller@1.22.4(patch_hash=c631278492f0113f42fa8bed43c7d8ed5779424dd12af0cefc55132c2ee1d84c)(react-native-reanimated@4.7.0(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
20052
+ react-native-keyboard-controller@1.22.6(patch_hash=6e448411781347cd0b87868ee279117514a399801c18f233ddca4fa3935be75d)(react-native-reanimated@4.7.0(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
20053
dependencies:
20054
react: 19.3.0
20055
react-native: 0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
pnpm-workspace.yaml
+2
-2
@@ -143,7 +143,7 @@ minimumReleaseAgeExclude:
143
- "react@19.3.0"
144
- "react-dom@19.3.0"
145
- "react-native@0.88.0-rc.3"
146
- - "react-native-keyboard-controller@1.22.4"
146
+ - "react-native-keyboard-controller@1.22.6"
147
- "react-native-worklets@0.13.0"
148
- "react-native-reanimated@4.7.0"
149
- "react-native-screens@4.28.0"
@@ -260,7 +260,7 @@ patchedDependencies:
260
# Link http(s) URLs with a port or a single-label host. md4c otherwise requires a dotted host and stops at ':'.
261
react-native-nitro-markdown@0.5.8: patches/react-native-nitro-markdown@0.5.8.patch
262
react-native-gesture-handler@3.2.1: patches/react-native-gesture-handler@3.2.1.patch
263
- react-native-keyboard-controller@1.22.4: patches/react-native-keyboard-controller@1.22.4.patch
263
+ react-native-keyboard-controller@1.22.6: patches/react-native-keyboard-controller@1.22.6.patch
264
react-native-nitro-modules@0.35.9: patches/react-native-nitro-modules@0.35.9.patch
265
react-native-screens@4.28.0: patches/react-native-screens@4.28.0.patch
266
uniwind@1.11.0: patches/uniwind@1.11.0.patch