lawnstarter / react-native-picker-select

🔽 A Picker component for React Native which emulates the native <select> interfaces for iOS and Android
https://npmjs.com/package/react-native-picker-select
MIT License
1.75k stars 498 forks source link

Picker size changes according to content when minWidth, width and a custom placeholder is used. #571

Open Josh2941 opened 5 months ago

Josh2941 commented 5 months ago

Picker size changes according to content when minWidth, width and a custom placeholder is used. This happens when I place a Picker next to a TextInput field where both will have 50% width. Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create a View with flexDirection: 'row'
  2. Place any component on the left side with flex: 1
  3. Place the Picker on the right side and try to give equal space for both the components
  4. Use a custom placeholder.
  5. You can notice the issue. The picker change its width based on the option selected.

Expected behavior
The Picker size should never change no matter how big or small the text content is inside it.

Screenshots
Making the width as 90% is not changing the overall width but the width of the text inside the picker

Screenshot 2024-04-14 at 12 51 37 AM

Additional details

Reproduction and/or code sample
Check out this snack where I have reproduced -> https://snack.expo.dev/IJjBAHlomzTQiSS8Pk9Wx Select iOS simulator in the snack to reproduce the issue.