TextInput placeholder remains empty when multiline is true and the placeholder is set after certain timeout
Description
A bug with TextInput when multiline is true and the placeholder is set after certain timeout.
This bug only happens on iOS. It works fine on Android.
React Native version:
System:
OS: macOS 11.0.1
CPU: (8) x64 VirtualApple @ 2.50GHz processor
Memory: 65.97 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 26, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242-release - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
- Create a
TextInput, then set themultilineprops totrueand leave theplaceholdervalue empty. - Set a timeout to run a function that will set the
placeholdervalue to a certain text. - On time out, the placeholder will remain empty.
Expected Results
On time out, the placeholder should show up with the value similar to the text set.
Snack, code example, screenshot, or link to a repository:
https://github.com/endronk/textinput-placeholder-multiline-bug
Interesting, thank you for the repro!
I was able to reproduce it, the placeholder prop is not handling updates correctly.
I'm having the same issue, there are any news about a fix?
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Any news?
init value set space can fixed
<TextArea placeholder={pageType === 'detail' ? ' ' : 'hello world'} ... />
Any updates on this? I'm still experiencing this same issue.
[!IMPORTANT] ⚠️ This is the workaround ⚠️
init value set space can fixed
<TextArea placeholder={pageType === 'detail' ? ' ' : 'hello world'} ... />@johnmeng24
Dynamic placeholders can be fixed by using ' ' (space character) as the empty value instead of an empty string ('') or undefined.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.