Skip to content
Open
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
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ declare module 'react-native-select-dropdown' {
* function callback when the search input text changes, this will automatically disable the dropdown's internal search to be implemented manually outside the component
*/
onChangeSearchInputText?: (searchText: string) => void;
/**
* search input text value for controlled search input
*/
searchInputTextValue?: string;
/**
* function returns React component for search input icon
*/
Expand Down
3 changes: 2 additions & 1 deletion src/SelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const SelectDropdown = (
renderSearchInputLeftIcon /* function returns React component for search input icon */,
renderSearchInputRightIcon /* function returns React component for search input icon */,
onChangeSearchInputText /* function callback when the search input text changes, this will automatically disable the dropdown's interna search to be implemented manually outside the component */,
searchInputTextValue /* search input text value for controlled search input */,
},
ref,
) => {
Expand Down Expand Up @@ -128,7 +129,7 @@ const SelectDropdown = (
search && (
<Input
searchViewWidth={buttonLayout.w}
value={searchTxt}
value={searchInputTextValue ?? searchTxt}
valueColor={searchInputTxtColor}
placeholder={searchPlaceHolder}
placeholderTextColor={searchPlaceHolderColor}
Expand Down