Skip to content

numberOfLines not working for MultiSelect #188

Open
@eduardo-santos-tribia

Description

@eduardo-santos-tribia

Hi, the current MultiSelect component doesn't allow much customization with the selected content in terms of listing them separated by commas for example, and keep the MultiSelect Dropdown with the same height size, and number of lines. The UI I want to achieve is something like this:

image

I tried with the renderSelectedItem but it didn't work as expected, so I decided to use the placeholder prop to achieve this UI, it worked but when the placeholder content is bigger than the Dropdown it breaks to a second line and I don't want it.

So, I was checking the lib code, and the selectedTextProps is not used for MultiSelect and I decided to add it as a patch to the library. If anyone else has this issue I'm posting the patch solution below:

The file should be placed inside the patch folder in the root of your project:
react-native-element-dropdown+2.9.0.patch

PS: I didn't have much time to create a PR for this, so feel free to create a PR with this solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions