Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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 @@ -29,7 +29,6 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef<any>)
value: controlledValue,
onChangeText,
onClear,
containerStyle,
customRightElement,
style,
inaccessible
Expand Down Expand Up @@ -101,7 +100,6 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef<any>)
};

const onChangeTextHandler = (text: string) => {
console.log(`onChangeTextHandler, text:`, text);
onChangeText?.(text);
setValue(text);
setHasValue(!_.isEmpty(text));
Expand Down Expand Up @@ -153,27 +151,28 @@ const SearchInput = forwardRef((props: SearchInputProps, ref: ForwardedRef<any>)
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;
return (
<View style={[styles.inputContainer, {height}]}>
<TextInput
accessibilityRole={'search'}
placeholder={placeholder}
placeholder={others.placeholder}
placeholderTextColor={placeholderTextColor}
underlineColorAndroid="transparent"
selectionColor={selectionColor}
{...others}
ref={searchInputRef}
value={value}
allowFontScaling={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface SearchInputRef {
focus: () => void;
}

export type SearchInputProps = TextInputProps & {
export type SearchInputSpecificProps = {
/**
* On clear button callback.
*/
Expand Down Expand Up @@ -66,3 +66,5 @@ export type SearchInputProps = TextInputProps & {
*/
preset?: SearchInputPresets | `${SearchInputPresets}`;
};

export type SearchInputProps = Omit<TextInputProps, 'style' | 'ref'> & SearchInputSpecificProps;