Open kavimuru opened 1 year ago
Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!
@johncschuster Eep! 4 days overdue now. Issues have feelings too...
@daraksha-dk I tried reproducing this behavior on a Google Pixel 7 (via browserstack) and was unable to get the first character to flicker. Can you help me dial in the reproduction steps a bit more?
from @daraksha-dk (thank you!)
I can reproduce this consistently on Pixel 3a and 4a. Here are the steps & a video for the same. Open the app Go to Setting Go to Security Click on close account Write a single character
Ok, I've reproduced the behavior using a Pixel 3a (v. 1.2.73-1
). To me, it seems more like the first letter is "jumping" ever so slightly, but I do agree that the first letter is behaving differently than all following letters in the input field.
https://user-images.githubusercontent.com/5579997/219700680-a723dda6-0153-46be-83e9-8b0bd5d6dace.mp4
Triggered auto assignment to @techievivek (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
@johncschuster @techievivek this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!
Will look into it by today.
I can reproduce this on my OnePlus 7T, and this can be worked externally.
Job added to Upwork: https://www.upwork.com/jobs/~01068656221cc9737e
Triggered auto assignment to @zanyrenney (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @aimane-chnaif (External
)
Current assignee @techievivek is eligible for the External assigner, not assigning anyone new.
The text being entered in a multiline input causes it to jump.
The root cause of this issue is using line height in the style for the text input here: https://github.com/allroundexperts/Expensify/blob/feedecf0c6d218bff94abbf4943b9a69bbad374a/src/styles/styles.js#L774 When text is entered, the line height gets applied and the text gives a jumping effect.
The same issue happens on report composer as well once it gets switched to multiline input. bug.webm
We can remove the line height on android for multiline text input. This will solve our issue.
Works well after applying the fix. bug 2.webm
As mentioned here, we can add some temporary hacks such as making sure vertical padding is set to 0 and wrapping text inside input using the <Text>
tag. I however, think that we shouldn't go with workarounds and remove the line height from text input which isn't very well supported on native platforms. cc @shawnborton for your opinion.
From a technical perspective I'm not entirely sure what opinion I have to offer, as long as we can fix the bug and keep things visually looking as they should be. Perhaps we want to have one of our engineers take a look through the proposals? cc @techievivek
From a technical perspective I'm not entirely sure what opinion I have to offer, as long as we can fix the bug and keep things visually looking as they should be. Perhaps we want to have one of our engineers take a look through the proposals? cc @techievivek
@shawnborton You can confirm the result by looking at this video: bug 2.webm
Looks good from what I can tell, but curious what Vivek thinks too.
The text is jumping on first character
The issue happens on android due to the fact the android placeholder line height doesn't respect the assigned line height, even if it isn't displayed (like in many if not most places in the app), those on first character the line height is readjusted to the one being set and the "jump" happens.
here is an example with a placeholder to show the issue. https://www.loom.com/share/71fde36c70404fe4b137e37c5659798a
it is most likely the best solution to remove the line-height for android so it will use the native line height size as mentioned by @allroundexperts, without intervention into native implementation.
None
@allroundexperts The proposed change looks good to me. Can you please share some more screenshots of different pages where we use the TextInput
component on Android Native? I just want to make sure we don't break anything existing before moving forward with the proposed solution.
CCing @aimane-chnaif to have a look at the proposal.
@techievivek I could find the multiline text input being used at two pages (close account and composer on the report page). I have attached the video that contains both:
(For single line input, we're already disabling line height)
For single line input, we were fine to remove line height because there was no visual change. But if we remove line height for multiline input, there will be visual change and clearly noticeable to users, especially when device font size is extremely small or height. But there's no impact like text is clipped because if we remove line height, text height is set automatically, respecting font family and size. And for platform consistency, if we remove line height for android, I think it should be applied to all other platforms as well.
@shawnborton do you think it's fine to remove line height everywhere (including chat composer) for any text input?
In video: 1 - device large font with lineHeight set 2- device large font with lineHeight removed 3 - device small font with lineHeight set 4- device small font with lineHeight removed
@johncschuster @techievivek @zanyrenney @aimane-chnaif this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
@shawnborton Can you please have a look at the comment posted here https://github.com/Expensify/App/issues/14799#issuecomment-1441271035 by @aimane-chnaif
I'm not sure what the ramifications would be for removing the line height. I know we looked at this quite a bit for the new text input improvements, cc @parasharrajat @Luke9389 if you have any thoughts there?
We had some problems with consistency of text inputs after removing line height, but if @allroundexperts is able to remove line height only for multiline inputs on android, then I think it'll be fine. I'm curious though, why is the line height value changing from when the box is empty to when there is text. In other words, if the line height was constant, there would be no "jumping" or "flickering", right?
@Luke9389 This is a specific issue with RN. I've prepared a snack which you can use to play around with this behaviour. A video of the same snack is attached as well.
We had some problems with consistency of text inputs after removing line height
@Luke9389 can you please link that discussion?
@aimane-chnaif, this issue was caused by line-height.
@allroundexperts Thanks for that, I'll check that out today.
Thanks for the demo @allroundexperts, that was cool.
I think the main thing to consider is how this change will effect all of our text inputs. We need a proposal that fixes this issue for multiline inputs and doesn't break single line inputs.
I saw this article that says RN will trim descending text (like j
q
and p
) but iOS will trim ascending text like Ñ
.
Thanks for the demo @allroundexperts, that was cool.
I think the main thing to consider is how this change will effect all of our text inputs. We need a proposal that fixes this issue for multiline inputs and doesn't break single line inputs.
I saw this article that says RN will trim descending text (like
j
q
andp
) but iOS will trim ascending text likeÑ
.
@Luke9389 Thank you for the reply. My understanding is that this proposal will apply to Android Multiline Inputs only. We won't be touching other platforms or single line inputs. Can you please shed some more light on why this won't work?
Hey @allroundexperts, if your proposal changes Android multiline inputs only, then I think we should proceed.
Thoughts @aimane-chnaif?
@Luke9389 lineHeight
was already removed for single line input on all platforms (this is on main
).
I don't find any impacts of removing lineHeight
for multiline input on all platforms including iOS.
So still not convinced that this fix should be applied to android multiline inputs only.
But there's no impact like text is clipped because if we remove line height, text height is set automatically, respecting font family and size.
Please check my comment here
Line height changes have a direct impact on native inputs. Let's make sure that this small change does not cause big issues for us. Also, we should not repeat history if someone added it to fix another issue.
@parasharrajat Are you suggesting to use it in android only?
I am suggesting to be careful about these changes which look small but have a big impact. I won't suggest jumping into it unless we have full coverage of the effects. Also, implemented should be fully aware of the grey areas.
It seems like the reason we added this was this bug. However, after reading this comment from the author of the accepted proposal, it looks like that there were multiple ways to fix the issue. The issue could have been fixed by either removing the line height completely or increasing it a little more. The author decided to go with the second approach ie increasing the line height. That introduced this bug. Looks like we can safely remove the line height.
That introduced this bug
That's not true. This bug existed before that fix (increasing lineHeight) but flickering was in reverse (large -> small). After that PR, flickering is small -> large. As long as lineHeight
is not exactly same as text height grown by font family and size, this issue won't be fixed.
This issue was reported on Feb 3 and that PR was merged on Feb 22
As long as
lineHeight
is not exactly same as text height grown by font family and size, this issue won't be fixed.
You're correct @aimane-chnaif. I did not notice that. Emojis seem to work fine after removing this 😕
@aimane-chnaif This seems to have been added with this PR.
From reading the comments and clicking the linked PRs I am a little lost on where we have landed here. If we think a fix for lineHeight and ensuring it works small -> large was merged on Feb 22nd. Are we saying this proposal would impact that fix? Or, that we don't need this proposal here as well? cc. @allroundexperts @techievivek @aimane-chnaif Thanks!
@zanyrenney As far as I've tested, removing the line height does not cause any other bug to resurface (At least on android). @aimane-chnaif might have more context here though.
https://github.com/Expensify/App/pull/12447#issuecomment-1340156656 (the fix was removing lineHeight
)
https://codeburst.io/react-native-quirks-2fb1ae0bbf80
All concerns so far are based on lineHeight
set (either small or big).
There's direct impact of course when lineHeight
is removed but not bad impact at all.
@kbecciv reported issue on iOS composer ~which happens because of not enough lineHeight
. The fix requires increasing lineHeight
a bit more.
So I don't think removing lineHeight
on all platforms is ideal solution.~
I confirmed that https://github.com/Expensify/App/issues/15640 is not related to lineHeight
. Even if it's very large, next line cursor starts at the bottom of first line.
Thanks for jumping in @situchan!
I can see that we're already using lineHeightXLarge
. In my opinion, It does not make sense to go beyond this. Also, I think this issue is not related to line height. You can remove the line height and the same issue still exists. In fact, I just tested it in expo and it exists there as well. You can check this as well here.
@johncschuster @techievivek @zanyrenney @aimane-chnaif this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks!
Current assignee @aimane-chnaif is eligible for the Internal assigner, not assigning anyone new.
I have removed the internal label because it looks like we have a potential fix in the discussion. @aimane-chnaif @allroundexperts Looking at the linked issue https://github.com/Expensify/App/issues/14674, I feel like it should be safe to get rid of line height for multiline inputs.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Alternative steps:
Expected Result:
No flickering should happen
Actual Result:
The first character will flicker
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.64-2 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/216621627-ee3048e3-9a79-4487-94b6-af4eb2b3e679.mp4
https://user-images.githubusercontent.com/43996225/216621639-6ff88751-abbb-4f4a-a866-e6c8cc028a2a.mp4
Expensify/Expensify Issue URL: Issue reported by: @daraksha-dk Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674823661904079
View all open jobs on GitHub
Upwork Automation - Do Not Edit