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

Change style for TextInput area #5704

Merged
merged 6 commits into from
Oct 12, 2021

Conversation

AlfredoAlc
Copy link
Contributor

Details

Set selectable prop in ExpensiTextInputLabel to false.
Move padding props from expensiTextInputContainer to expensiTextInput to prevent the TextInput to switch between blur and focus when clicking in the text label.

Fixed Issues

$ #4515

Tests

  1. Open profile page.
  2. Clear the First Name text input.
  3. Focus the text input.
  4. Press inside the text input container, it shouldn't blur nor select the text input label

QA Steps

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Web screenshot

Desktop

Desktop screenshot

@AlfredoAlc AlfredoAlc requested a review from a team as a code owner October 6, 2021 21:35
@MelvinBot MelvinBot requested review from timszot and removed request for a team October 6, 2021 21:35
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@AlfredoAlc
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@parasharrajat
Copy link
Member

recheck

@parasharrajat
Copy link
Member

@AlfredoAlc is it ready for review?

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat yes, it is ready to review

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Why is package-lock.json changed? It should have not been changed. please revert it.

And don't worry about the CLA checks. As soon as the assigned engineer will trigger the actions, they will be all ✔️ .

@AlfredoAlc
Copy link
Contributor Author

It was modified when ran npm install, I forgot to revert that change.

I already revert the file.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

LGTM. It will be merged after n6-hold is lifted.

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

Sorry, found a regression
Input on search page got affected by this and placeholder is not centered.

image

@AlfredoAlc
Copy link
Contributor Author

AlfredoAlc commented Oct 7, 2021

I can use the approach from the View container, and use the condition to see if it doesn't has a label then remove the paddingTop and paddingBottom.

Move this condition from the View to the TextInput in the style prop.

pv0: {
paddingTop: 0,
paddingBottom: 0,
},

Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

A minor lint issue otherwise looks good.

@@ -194,7 +193,7 @@ class BaseExpensiTextInput extends Component {
placeholder={(this.state.isFocused || !label) ? placeholder : null}
placeholderTextColor={themeColors.placeholderText}
underlineColorAndroid="transparent"
style={inputStyle}
style={[inputStyle, !hasLabel && styles.pv0,]}
Copy link
Member

Choose a reason for hiding this comment

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

No Trailing comma here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, let me remove that comma.

parasharrajat
parasharrajat previously approved these changes Oct 8, 2021
Copy link
Member

@parasharrajat parasharrajat left a comment

Choose a reason for hiding this comment

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

LGTM and tests well.

Ready for final review and merge when n6-hold is lifted.

Copy link
Contributor

@timszot timszot left a comment

Choose a reason for hiding this comment

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

Code looks good to me, but you have conflicts now. Please resolve those and this should be ready for merge.

@timszot timszot merged commit 50beee9 into Expensify:main Oct 12, 2021
@OSBotify
Copy link
Contributor

@AlfredoAlc, Great job getting your first Expensify/App pull request over the finish line! 🎉

I know there's a lot of information in our contributing guidelines, so here are some points to take note of 📝:

  1. Now that your first PR has been merged, you can be hired for another issue. Once you've completed a few issues, you may be eligible to work on more than one job at a time.
  2. Once your PR is deployed to our staging servers, it will undergo quality assurance (QA) testing. If we find that it doesn't work as expected or causes a regression, you'll be responsible for fixing it. Typically, we would revert this PR and give you another chance to create a similar PR without causing a regression.
  3. Once your PR is deployed to production, we start a 7-day timer ⏰. After it has been on production for 7 days without causing any regressions, then we pay out the Upwork job. 💰

So it might take a while before you're paid for your work, but we typically post multiple new jobs every day, so there's plenty of opportunity. I hope you've had a positive experience contributing to this repo! 😊

@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@marcaaron
Copy link
Contributor

Pretty sure this caused a regression with labels on autofilled forms. Since they have a z-index of -1 they're now hidden
2021-10-13_13-35-13

The autofill also expands beyond the edges but unsure if that was introduced in this PR.

@marcaaron
Copy link
Contributor

Probably we want something more like this?
2021-10-13_13-36-51

@parasharrajat
Copy link
Member

parasharrajat commented Oct 14, 2021

@AlfredoAlc Could you please create a new PR solving the regression?

Yes, it seems z-index is causing the issue.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat @marcaaron Yes, I will take a look to solve this regression

@parasharrajat
Copy link
Member

Thank you. Please tag me so that I can test it.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat I already created the new PR

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @timszot in version: 1.1.7-25 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@parasharrajat
Copy link
Member

@AlfredoAlc Another regression I found is that label is messing up with the Multiline TextInput.

Screenshot 2021-10-15 19:19:46

Also, the right corner is overflowing the right edges.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat I suggest adding a background to the label, since the label is an Animated.Text if a background is set, it doesn't fill the whole space where it is, so I added a View with a white background. But, when it is autofilled the area of the label stays white. See attached video.

Screen.Recording.2021-10-15.at.14.40.05.mov

Let me know if this change is OK, so I can create a new PR with this solution.
Also, I couldn't reproduce the right corner overflowing.

@parasharrajat
Copy link
Member

parasharrajat commented Oct 19, 2021

Sorry, I missed your comment, somehow.

Initially, I was thinking the same but It does not look good. Do you have any other way of fixing it? We can rethink the original solution as well.

Meanwhile, I will try to find something.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat Sure, I will find another way to fix this.. I'll let you know here.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat As much as I try to find a way to work it out, there are some points to consider, when Autofilling is used:

  1. The background color is only set to the TextInput. So the whole container would not get the background color unless the TextInput fills the container(The way it is right now).
  2. Not all browsers and not all autofill types fire up an event( so it wouldn't be possible to know when autofill value is selected).
  3. The label has an absolute position, due to its animation. So if a background is not set to the label, it will overlap with the TextInput value (The way it is right now).

I will keep looking into a solution that works best, just keeping you updated.

@parasharrajat
Copy link
Member

Thanks for the update.
@AlfredoAlc I tried myself to find a solution. we won't be able to fill the complete background color for autofill.

This is what I think is best:

  1. Only for multiline inputs, implement this Change style for TextInput area #5704 (comment).

How does that sound?
This regression is blocking deployment so we can move with the solution and I don't think other is possible. I checked other libs and none of them have an autofill background on the full container.

@AlfredoAlc
Copy link
Contributor Author

@parasharrajat I will create a new PR with this approach.

@parasharrajat
Copy link
Member

Thanks. You can comment on the main issue.

@AlfredoAlc AlfredoAlc mentioned this pull request Oct 20, 2021
5 tasks
@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.8-9 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

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

Successfully merging this pull request may close these issues.

None yet

5 participants