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

feat: numberOfLines prop on iOS #291

Merged

Conversation

mateusz1913
Copy link
Contributor

Add multiline support for iOS picker. numberOfLines prop on iOS accepts integer value greater or equal to 1.
Picker rows' height is based on that prop.

NOTE in order to prevent multiline text being cut on leading and trailing edges on iOS 14, there is hardcoded horizontal padding of 20pts added to UILabel (Closes #212), potentially in future, it can be adjusted via style or itemStyle props

@mateusz1913
Copy link
Contributor Author

Hi @Naturalclar , there seems to be some flow error in CI, also there are merge conflicts. Let me know what should be fixed to make CI pass, I'll also resolve merge conflicts

@pierluigizagaria
Copy link

I think this needs to be accepted!
I'm having problems with long strings and the horizontal padding is disturbing me!

Add multiline support for iOS picker. `numberOfLines` prop on iOS accepts integer value greater or equal to 1.
Picker rows' height is based on that prop.

**NOTE** in order to prevent multiline text being cut on leading and trailing edges on iOS 14, there is hardcoded horizontal padding of 20pts added to UILabel (Closes react-native-picker#212), potentially in future, it can be adjusted via `style` or `itemStyle` props
@mateusz1913
Copy link
Contributor Author

👋 Fixed CI error and resolved merge conflicts

Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateusz1913 sorry for the late response, tested and it LGTM!

@Naturalclar Naturalclar merged commit 3fdddb6 into react-native-picker:master Oct 6, 2021
@macfanatic macfanatic mentioned this pull request Oct 28, 2021
github-actions bot pushed a commit that referenced this pull request Nov 4, 2021
# [2.2.0](v2.1.0...v2.2.0) (2021-11-04)

### Features

* Allow using WinUI 3 Controls ([#342](#342)) ([ea17798](ea17798))
* numberOfLines prop on iOS ([#291](#291)) ([3fdddb6](3fdddb6))
@Naturalclar
Copy link
Contributor

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Picker Item text gets cut using textAlign: 'left', or right in iOS 14>
3 participants