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 horizontal padding does not update on iOS #14645

Closed
davidlongest opened this issue Jun 20, 2017 · 7 comments
Closed

TextInput horizontal padding does not update on iOS #14645

davidlongest opened this issue Jun 20, 2017 · 7 comments
Assignees
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@davidlongest
Copy link

Description

What happens

When changing horizontal padding (paddingRight, paddingLeft, paddingHorizontal) on a TextInput during focus change, the text in the TextInput view should reflect the padding change.
What makes this especially odd is that changing any vertical padding by more than the height of the view (for height 20 can have left and right of 10 or horizontal of 20) makes the text respect the horizontal padding changes.

What I expected

When changing the horizontal padding, the text should change position to respect the padding.

Reproduction Steps

Using the sample code below...

  1. Note the two TextInput fields have space between the text and border
  2. Click or tap the first field to give it focus
  3. Note that text changes to red, but there is still padding between the text and border
  4. Open the inspector and click the focused field
  5. Note that the content area (blue) fills the entire text view (showing 0 padding)
  6. Click the unfocused field
  7. Note the padding area (green) fills up the empty area next to the text

Sample Code

Run the code below on iOS and switch focus between the two text inputs. Opening the inspector shows that the padding is updated, but the text itself doesn't actually update its position.

https://snack.expo.io/S1B3TZv7Z

Solution

The ideal fix is to make sure horizontal padding updates are respected, even if it is on one axis. The issue doesn't seem to lie within what React thinks the view should look like, but instead with the actual iOS view code.

Additional Information

  • React Native version: 0.45.0
  • Platform: iOS 10.2
  • Development Operating System: macOS Sierra 10.12.5
  • Build tools: XCode 8.2.1
@davidlongest davidlongest changed the title TextInput Horizontal Padding does not update on iOS TextInput horizontal padding does not update on iOS Jun 20, 2017
@shergin shergin self-assigned this Jun 22, 2017
@shergin shergin added the Platform: iOS iOS applications. label Jun 22, 2017
@davidlongest
Copy link
Author

Verified still happens in 0.46.0

@atlanteh
Copy link
Contributor

Yep, happens to me too

@inevermore
Copy link

inevermore commented Aug 29, 2017

Happens to me too in 0.47

@stale
Copy link

stale bot commented Oct 28, 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 Oct 28, 2017
@shergin shergin removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 31, 2017
@stale
Copy link

stale bot commented Dec 30, 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 30, 2017
@stale stale bot closed this as completed Jan 6, 2018
@shergin shergin reopened this Jan 6, 2018
@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 6, 2018
@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Component: TextInput Related to the TextInput component. labels Mar 16, 2018
@stale
Copy link

stale bot commented Jun 14, 2018

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 "For Discussion" or "Good first issue" and I will leave it open. 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 Jun 14, 2018
@stale
Copy link

stale bot commented Jul 14, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jul 14, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
No open projects
Better <TextInput>
Awaiting triage
Development

No branches or pull requests

5 participants