react-native-element-dropdown
react-native-element-dropdown copied to clipboard
Add searchBothFieldFunction to labelField, valueField and Empty result message
This pull request introduces a new function, searchBothFieldFunction, to the labelField and valueField components. This function allows for more flexible and efficient searching by enabling users to search for values that match either the label or the value field.
Key changes:
- Added
searchBothFieldFunctionproperty: This property is added to bothlabelFieldandvalueFieldcomponents. It takes a function as input, which will be called with the search query and the current item being searched. The function should returntrueif the item matches the search query, andfalseotherwise. - Updated search logic: The search logic in both components is modified to use the
searchBothFieldFunctionif it's provided. If the function is not provided, the default search behavior remains unchanged. - Empty result message: The empty result message is updated to
"No Result Found."
Benefits:
- Enhanced search functionality: Users can now search for values based on either the
labelor thevaluefield, providing more flexibility and accuracy in their searches. - Improved efficiency: The
searchBothFieldFunctioncan be customized to optimize search performance for specific use cases. - Increased usability: The added search functionality makes it easier for users to find the information they need.
@hoaphantn7604 @myou11 kindly merge the PR.