toystars / react-native-multiple-select

Simple multi-select component for react-native
MIT License
565 stars 313 forks source link

Special characters crash on partial filter method (regex) #116

Open crcnum4 opened 4 years ago

crcnum4 commented 4 years ago

Issue summary

This is just to make aware that the filterMethod="partial" (default filtering system) uses regex and as such special characters such as brackets and slashes causes the application to crash.

Library versions

react-native: 0.59.8 react-native-multiple-select: 0.5.3

Steps to Reproduce

  1. using a normal Multiselect enter some text then add a special character
  2. Full app crash

Expected Behavior

The app should not crash. options:

  1. hide all items and display search error.
  2. display all items
  3. hide all items

possible fixes:

  1. move away from regex
  2. check searchterm for special characters and either disallow them (do not add to searchterm) or display instant error.