react-native-element-dropdown icon indicating copy to clipboard operation
react-native-element-dropdown copied to clipboard

Add searchBothFieldFunction to labelField, valueField and Empty result message

Open aravind3566 opened this issue 1 year ago • 1 comments

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 searchBothFieldFunction property: This property is added to both labelField and valueField components. It takes a function as input, which will be called with the search query and the current item being searched. The function should return true if the item matches the search query, and false otherwise.
  • Updated search logic: The search logic in both components is modified to use the searchBothFieldFunction if 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 label or the value field, providing more flexibility and accuracy in their searches.
  • Improved efficiency: The searchBothFieldFunction can 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.

aravind3566 avatar Oct 17 '24 01:10 aravind3566

@hoaphantn7604 @myou11 kindly merge the PR.

aravind3566 avatar Dec 06 '24 04:12 aravind3566