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

TextInput padding not working on Android #16405

Closed
gitlovenotwar opened this issue Oct 16, 2017 · 3 comments
Closed

TextInput padding not working on Android #16405

gitlovenotwar opened this issue Oct 16, 2017 · 3 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@gitlovenotwar
Copy link

Is this a bug report?

Yes. On android, TextInput padding not working when its parent has display: none/flex to show/hide the TextInput. It works fine when the TextInput will be mounted/unmounted.

Environment

Environment:
OS: macOS Sierra 10.12.5
Node: 6.11.1
Yarn: 0.27.5
npm: 5.3.0
Watchman: 4.7.0
Xcode: Xcode 8.3.2 Build version 8E2002
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react: 16.0.0-beta.5 => 16.0.0-beta.5
react-native: 0.49.3 => 0.49.3

Steps to Reproduce

  1. Parent Component of TextInput has display: 'none' when component mounted
  2. Click to some button to show the parent component having display from 'none' to 'flex'

Expected Behavior

Padding should work just the same on iOS, TextInput padding on iOS works always even parent is displayed or not(NOTE: not mounted/unmounted but using style display: 'none'/'flex')

Actual Behavior

On Android, padding not working on TextInput

@stale
Copy link

stale bot commented Dec 15, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 15, 2017
@stale stale bot closed this as completed Dec 22, 2017
@provedotit
Copy link

This is still an issue on 0.53. The workaround is to use absolute positioning and a negative zIndex when you want to hide the input instead of display: none.

@zarincheg
Copy link

This is still a problem in 0.50. But if render TextInput by visibility condition it works fine.

const field = !invisible ? <TextInput placeholder="Write here" /> : null;
return (<View style={invisible ? { display: 'none' } : { display: 'flex' }}>{field}</View>);

@facebook facebook locked as resolved and limited conversation to collaborators Dec 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants