From d8df2c4bf30f40a9d341f050da04392a9668516a Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 13 Jul 2026 15:54:39 +0100 Subject: [PATCH] feat: KeyboardAwareLegendList forwards onContentInsetChange Previously onContentInsetChange was used internally but it wasn't exposed. Now callers can pass it too (and it doesn't break anything internal) --- src/integrations/keyboard.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/integrations/keyboard.tsx b/src/integrations/keyboard.tsx index 222387c7..063e799b 100644 --- a/src/integrations/keyboard.tsx +++ b/src/integrations/keyboard.tsx @@ -24,13 +24,7 @@ if (typeof __DEV__ !== "undefined" && __DEV__ && !KeyboardChatScrollView) { type KeyboardChatScrollViewPropsUnique = Omit< KeyboardChatScrollViewProps, - | keyof ScrollViewProps - | "inverted" - | "ScrollViewComponent" - | "blankSpace" - | "extraContentPadding" - | "onContentInsetChange" - | "offset" + keyof ScrollViewProps | "inverted" | "ScrollViewComponent" | "blankSpace" | "extraContentPadding" | "offset" >; type KeyboardAwareLegendListProps = Omit< @@ -146,6 +140,7 @@ export const KeyboardAwareLegendList = typedForwardRef(function KeyboardAwareLeg freeze, keyboardLiftBehavior, keyboardOffset, + onContentInsetChange: onContentInsetChangeProp, ...rest } = props; @@ -174,9 +169,13 @@ export const KeyboardAwareLegendList = typedForwardRef(function KeyboardAwareLeg }; }, [anchoredEndSpace, blankSpace]); - const onContentInsetChange = useCallback((insets: KeyboardChatScrollViewContentInsets) => { - refLegendList.current?.reportContentInset(insets); - }, []); + const onContentInsetChange = useCallback( + (insets: KeyboardChatScrollViewContentInsets) => { + refLegendList.current?.reportContentInset(insets); + onContentInsetChangeProp?.(insets); + }, + [onContentInsetChangeProp], + ); const memoList = useCallback( (scrollProps: ScrollViewProps) => {