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

Blocks of quoted text render incorrectly on mobile #986

Closed
jboniface opened this issue Dec 16, 2020 · 18 comments · Fixed by #2307 or #2527
Closed

Blocks of quoted text render incorrectly on mobile #986

jboniface opened this issue Dec 16, 2020 · 18 comments · Fixed by #2307 or #2527
Assignees

Comments

@jboniface
Copy link

jboniface commented Dec 16, 2020

If you haven’t already, check out our contributing guidelines for onboarding!


View the job on Upwork here.

Platform - version:

iOS and Android, build 263

Action Performed (reproducible steps):

  1. Type a sentence with code block formatting (single ticks) in the middle, like this:

This is a test to see how code renders in the middle of a sentence on mobile.

  1. Notice that it renders strangely by either breaking the line or overflowing.

Expected Result:

It should render the same way it does here on GitHub.

This is a test to see how code renders in the middle of a sentence on mobile.

Actual Result:

The line either breaks or overflows where the code formatting starts/ends

Notes/Photos/Videos:

We've seen multiple results from this bug. Here are some examples:

101217023-6e804a00-3635-11eb-9bb9-2e37a0eeccbb

102281699-4c22f080-3f94-11eb-878b-345b9d978e46

@sakul-budhathoki
Copy link

PR #1099

@telesensdev
Copy link

I worked with this bug

@laurenreidexpensify
Copy link
Contributor

@telesensdev can you clarify what the name you have registered in Upwork is? Thanks

@telesensdev
Copy link

@laurenreidexpensify upwork account - Eduard Rubin

@tugbadogan
Copy link
Contributor

Hi @jboniface, is this task still available? It looks like there isn't any activity for a while.

@jboniface
Copy link
Author

jboniface commented Feb 25, 2021

@tugbadogan we're not quite sure how to solve it optimally, and another contributor put up a PR that we weren't able to move forward with because it wasn't consistent across platforms. Do you have a proposal that would resolve this issue?

@mallenexpensify
Copy link
Contributor

Reposted this on Upwork https://www.upwork.com/jobs/~01fc428a62f97f17a2
Please create new comments for proposals, even if you're already commented above

@mallenexpensify
Copy link
Contributor

mallenexpensify commented Mar 24, 2021

@sketchydroide assigning to you to review incoming proposals because you were picked via auto-assigner for the issue in the Expensify repo

@aliabbasmalik8
Copy link
Contributor

@sketchydroide is it okay?
for ios
image

image

and for web
image

@sketchydroide
Copy link
Contributor

@sketchydroide is it okay?
for ios

I think for iOS we are expect the text to be on the same line as the rest of the text. It's wrapping well, and going to the next line correctly, but it also should be on the same line of the rest of the text, not on a new line.
Web looks good

Does that make sense @aliabbasmalik8

@sketchydroide
Copy link
Contributor

@aliabbasmalik8 Do you think you could do the changes as I described them?

@aliabbasmalik8
Copy link
Contributor

@sketchydroide did not found a solution according to the changes you described above.
There is two solution

  1. Blocks of quoted text render incorrectly on mobile #986 (comment)
  2. inline text but without border and padding properties.

BLOCKER: Not found any way to assign border and padding properties to <Text> element without using <View> if you have an idea how to do this please let me know.

Thanks

@parasharrajat
Copy link
Member

parasharrajat commented Apr 7, 2021

@sketchydroide I think this issue is hanging around for a long time. So I tried few techniques that could let us achieve the desired UI. I would like to work on this.

Problem

We(Including other contributors from the comments above) tried using a combination of Text & View tag to achieve the above UI but there are a couple of issues as follows:

  1. Text is rendered as a block box but we want inline text.
  2. In Another way, we can get the inline text but border and border-radius are not being rendered.

Solution

I had an idea of tokenizing the text. Then apply the style selectively. This is working well. I have made a small snap here.

  1. we create one wrapper component which divides the text into tokens(words) divided based on word break. This component put the text tokens inline into a view and renders it.
  2. We can then pass styles selectively to tokens and manage the border-radius for the first and last tokens.

@sketchydroide
Copy link
Contributor

@parasharrajat I think that might work, would be happy to see a PR using this

@mallenexpensify
Copy link
Contributor

Hired @parasharrajat in Upwork

@mallenexpensify
Copy link
Contributor

This closed 3 days ago, waiting til 4/27 to ensure no regressions then paying

@mallenexpensify mallenexpensify changed the title Blocks of quoted text render incorrectly on mobile [PAY ON 4/27] Blocks of quoted text render incorrectly on mobile Apr 23, 2021
@mallenexpensify
Copy link
Contributor

Paid 4/28 via Upwork. Thanks @parasharrajat

@mallenexpensify mallenexpensify changed the title [PAY ON 4/27] Blocks of quoted text render incorrectly on mobile Blocks of quoted text render incorrectly on mobile Apr 28, 2021
@parasharrajat
Copy link
Member

@mallenexpensify but PR is awaiting merge #2527.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment