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

Problem with overflow management on Gutenberg code block on chrome #26600

Closed
dcschreiber opened this issue Oct 30, 2020 · 7 comments · Fixed by #26623
Closed

Problem with overflow management on Gutenberg code block on chrome #26600

dcschreiber opened this issue Oct 30, 2020 · 7 comments · Fixed by #26623
Assignees
Labels
[Block] Code Affects the Code Block [Status] In Progress Tracking issues with work in progress

Comments

@dcschreiber
Copy link

Describe the bug
I have a code block with a long link and on Chrome on mobile the line is running out of the screen (No wrapping or overflow management). On Firefox mobile there is wrapping.

I am still seeing this on my website neutro when I view it on Chrome (Desktop windows 10 with mobile emulation and android 11. Chrome version version 86.0.4240.111) but not on Firefox (mobile version 82.1.1).
The problem is when I have a long URL in a Code block.
You can see my site here
WordPress 5.5.1
Theme Neve Version: 2.8.3

image

@OsakaWebbie
Copy link

I'm using Firefox on PC (v. 82), and code blocks now fail to wrap here also (destroying a layout that was fine a week ago - see https://abide-osaka.org/message-posting-clues/). I also have Chrome (v. 86) - I don't normally use it, but it also fails.

The code still wraps in the Wordpress editor - it only fails on the front-end.

@jasmussen
Copy link
Contributor

Thanks for the ticket, and thank you for the feedback.

Since it's suggested that this used to work but works no longer, I investigated whether this block changed in any way recently, and the only change made was in #26347@ellatrix do you have any idea whether that PR could've caused wrapping issues like these?

I'm going to create a PR to add a scrollbar to handle overflow, and wrapping with theme opt in.

@ellatrix
Copy link
Member

ellatrix commented Nov 2, 2020

We recently changed the code block to not use a textarea anymore, which now reflects the front-end. So if there's no wrapping on the front-end, there's no wrapping in the editor either.

@jasmussen
Copy link
Contributor

Interesting, but this would only affect the editor state, if anything, right?

@kjellr
Copy link
Contributor

kjellr commented Nov 2, 2020

I just tested this using an old WP version (5.3), and it looks like the editor did wrap the code block by default, but the front end did not.

Twenty Nineteen and Twenty Twenty provided front-end styles to enforce the wrapping there. In general, I think we should just make them match by default. Given that the past two default themes had these wrap, I think it's fine to wrap them by default natively.

@ellatrix
Copy link
Member

ellatrix commented Nov 3, 2020

In principle I think the editor should not be providing any styles by default, but if the default styles for this tag are bad, then it makes sense.

Interesting, but this would only affect the editor state, if anything, right?

What do you mean by editor state? A change from a text area to content editable does affect the wrapping. Text areas always wrap.

@jasmussen
Copy link
Contributor

What do you mean by editor state? A change from a text area to content editable does affect the wrapping. Text areas always wrap.

Right, I suppose to Kjell point, it always worked as it should in the editor, that is, with wrapping. The missing piece was the frontend.

@gziolo gziolo added the [Block] Code Affects the Code Block label Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Code Affects the Code Block [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants