From 19481e0d6e67cb1b3dc02ea9a57cfe9772576fb0 Mon Sep 17 00:00:00 2001 From: adids1221 Date: Tue, 20 Jan 2026 18:59:33 +0200 Subject: [PATCH] fix: enable prop overrides for SearchInput cancelButtonProps and TextInput props --- .../src/components/searchInput/index.tsx | 9 ++++----- .../src/components/searchInput/types.ts | 4 +++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/react-native-ui-lib/src/components/searchInput/index.tsx b/packages/react-native-ui-lib/src/components/searchInput/index.tsx index d152b013ef..c98f3a2ffc 100644 --- a/packages/react-native-ui-lib/src/components/searchInput/index.tsx +++ b/packages/react-native-ui-lib/src/components/searchInput/index.tsx @@ -29,7 +29,6 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef) value: controlledValue, onChangeText, onClear, - containerStyle, customRightElement, style, inaccessible @@ -101,7 +100,6 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef) }; const onChangeTextHandler = (text: string) => { - console.log(`onChangeTextHandler, text:`, text); onChangeText?.(text); setValue(text); setHasValue(!_.isEmpty(text)); @@ -153,16 +151,16 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef) color={invertColors ? INVERTED_TEXT_COLOR : undefined} $textDefault text65M - {...cancelButtonProps} onPress={onDismiss} testID={`${testID}.cancelButton`} + {...cancelButtonProps} /> ); } }; const renderTextInput = () => { - const {placeholder} = props; + const {containerStyle, ...others} = props; const height = getHeight(); const placeholderTextColor = invertColors ? INVERTED_TEXT_COLOR : Colors.$textDefault; const selectionColor = invertColors ? INVERTED_TEXT_COLOR : Colors.$textDefault; @@ -170,10 +168,11 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef) void; } -export type SearchInputProps = TextInputProps & { +export type SearchInputSpecificProps = { /** * On clear button callback. */ @@ -66,3 +66,5 @@ export type SearchInputProps = TextInputProps & { */ preset?: SearchInputPresets | `${SearchInputPresets}`; }; + +export type SearchInputProps = Omit & SearchInputSpecificProps;