hoaphantn7604 / react-native-element-dropdown

A react-native dropdown component easy to customize for both iOS and Android.
MIT License
1k stars 173 forks source link

numberOfLines not working for MultiSelect #188

Open eduardo-santos-tribia opened 1 year ago

eduardo-santos-tribia commented 1 year ago

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.

JonasChan31Degrees commented 1 year ago

HI Eduardo, good catch on this issue. I am trying what you did using your patch. The new props that has been patched however is not being shown when using the component. Can you please advise on this?

eduardo-santos commented 5 months ago

Hi @JonasChan31Degrees , I've created this PR to solve this. We just have to wait for someone to merge and release a new version.