Skip to content

Items being incorrectly filtered out #94

@leemcmullen

Description

@leemcmullen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions