Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items being incorrectly filtered out #94

Open
leemcmullen opened this issue Dec 14, 2021 · 0 comments
Open

Items being incorrectly filtered out #94

leemcmullen opened this issue Dec 14, 2021 · 0 comments

Comments

@leemcmullen
Copy link

I've discovered an issue where lots of items are incorrectly being filtered out of the list to select from, even though the search input is empty. This is happening on an Android emulator on Windows, with RN 0.66.3 and using Hermes.

I tracked it down to the filter call in the Helpers/index.ts file (https://github.com/pankod/react-native-picker-modal-view/blob/master/src/Helpers/index.ts#L50).

The filter function calls searchText.toLocaleLowerCase() as part of the process to filter out any items which don't match the search text. I tried to console.log the result of the .toLocaleLowerCase() call but it was returning the following error: "string length exceeds limit".

That was very confusing given that searchText was an empty string.

I eventually tracked the source of the issue down to an obscure Hermes bug where an empty string being passed to .toLocaleLowerCase() was not in fact returning an empty string but was instead "reading garbage UTF-16 codepoints
off the stack": facebook/hermes@54c8788

I'm just adding this here in case anyone else comes across the same thing and wonders why the full list is not being rendered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant