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

fix: adjust initial placeholder text value #3331

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

lukewalczak
Copy link
Member

@lukewalczak lukewalczak commented Aug 22, 2022

Summary

Solves: #3138 #1483

PR introduces a workaround to fix the problem with multiline iOS text input.

Description: Changing the placeholder text value dynamically, within multiline input on iOS, doesn't work properly – the placeholder is not displayed initially.

Root cause: Placeholder initial value, which has length 0.

More context: The issue was also reproduced in react-native, using its own TextInput, there is a snack: https://snack.expo.dev/ilKMCyNa8?platform=ios

Workaround: Set an empty space character in the default value.

Test plan

  • Tested manually on ios, text input placeholder is displayed.
  • Added test case and updated snapshots.

@callstack-bot
Copy link

Hey @lukewalczak, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

@github-actions
Copy link

The mobile version of example app from this branch is ready! You can see it here

.

@raajnadar
Copy link
Collaborator

This is a nice trick 👌, great job 👏

@lukewalczak lukewalczak merged commit 2ff4590 into main Aug 31, 2022
@lukewalczak lukewalczak deleted the fix/text-input-multiline branch August 31, 2022 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants