You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the picker component for a dynamic backend. In this case I use it for address research. However, if it is used as search function, the filtering will lead to a wrong list. Example: I search for "Street, City" and the backend will give the proper address like: "City, Street, zip code, Country". However, this might not match the search string and hence the list will be empty.
Therefore, it would be best to add prop to disable the filtering function.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-ui-lib/src/components/picker/helpers/usePickerSearch.js b/node_modules/react-native-ui-lib/src/components/picker/helpers/usePickerSearch.js
index 284ff32..a3f4bff 100644
--- a/node_modules/react-native-ui-lib/src/components/picker/helpers/usePickerSearch.js+++ b/node_modules/react-native-ui-lib/src/components/picker/helpers/usePickerSearch.js@@ -7,11 +7,12 @@ const usePickerSearch = props => {
showSearch,
onSearchChange,
children,
- getItemLabel+ getItemLabel,+ noFilter
} = props;
const [searchValue, setSearchValue] = useState('');
const filteredChildren = useMemo(() => {
- if (showSearch && !_isEmpty(searchValue)) {+ if (showSearch && noFilter && !_isEmpty(searchValue)) {
// @ts-expect-error need to fix children type
return _filter(children, child => {
// @ts-expect-error need to fix children type to be based on PickerItemProps
diff --git a/node_modules/react-native-ui-lib/src/components/picker/index.js b/node_modules/react-native-ui-lib/src/components/picker/index.js
index d023ed7..fc7edb4 100644
--- a/node_modules/react-native-ui-lib/src/components/picker/index.js+++ b/node_modules/react-native-ui-lib/src/components/picker/index.js@@ -37,6 +37,7 @@ const Picker = React.forwardRef((props, ref) => {
fieldType = PickerFieldTypes.form,
selectionLimit,
showSearch,
+ noFilter,
searchStyle,
searchPlaceholder,
renderCustomSearch,
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.I want to use the picker component for a dynamic backend. In this case I use it for address research. However, if it is used as search function, the filtering will lead to a wrong list. Example: I search for "Street, City" and the backend will give the proper address like: "City, Street, zip code, Country". However, this might not match the search string and hence the list will be empty.
Therefore, it would be best to add prop to disable the filtering function.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: