Hacktoberfest-2020-Emojipedia
Hacktoberfest-2020-Emojipedia copied to clipboard
NLSteveO/fix search field missing some results
Using the global flag for RegExp will advance the lastIndex property of the regExp when test returns true and resets lastIndex to zero when test returns false.
This works better when searching one large string and you want to find multiple results without getting the same result over and over. In the use case for Emojipedia we want the lastIndex to reset to zero because regExp will be searching a new string as we filter the list and so we want it to check from the beginning of each string.
@RishabhDevbanshi i noticed more people are creating issues recently so i'm wondering if you'd like me to create one to capture this in the mean time to help with getting this PR done? It's a small bug i noticed after creating my other PR #106 to add a few emojis but i'm not as concerned with that PR now, i'd just like to help fix the search bar mostly.
@RishabhDevbanshi i noticed more people are creating issues recently so i'm wondering if you'd like me to create one to capture this in the mean time to help with getting this PR done? It's a small bug i noticed after creating my other PR #106 to add a few emojis but i'm not as concerned with that PR now, i'd just like to help fix the search bar mostly.
You can work on it.