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

Sidebar text can overlap content #4635

Closed
ghost opened this issue Sep 5, 2021 · 8 comments
Closed

Sidebar text can overlap content #4635

ghost opened this issue Sep 5, 2021 · 8 comments
Labels
🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. sidebar/toc Sidebar and table of contents

Comments

@ghost
Copy link

ghost commented Sep 5, 2021

MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce

What information was incorrect, unhelpful, or incomplete?

Methods on the left are overlapping with the content in the middle of the page. It makes it difficult to read through this page.

Specific section or headline?

What did you expect to see?

I expected to see a clear separation between the main content and the menu on the left.

Did you test this? If so, how?

I tried to alter the zoom percentage but it didn't make a difference.

MDN Content page report details
@himanshugarg
Copy link

himanshugarg commented Sep 5, 2021

Thanks @najmieh . Would you like to include a screenshot in your report, as I don't see any overlapping content anywhere on the page
image


Edit: updated image to match provided. Apparently the sidebar items don't wrap for the OP's browser.

@ghost
Copy link
Author

ghost commented Sep 6, 2021

Yes sure. here it is:
1

@teoli2003
Copy link
Contributor

This is controlled by yari. @escattone, can you transfer the issue? Thanks!

@escattone escattone transferred this issue from mdn/content Sep 8, 2021
@KartikSoneji
Copy link
Contributor

image

Firefox seems to have a strange line-wrapping algorithm, where it breaks a word early and fills the next line.
In fact, there should be no line-wrapping according to the CSS:

Most of the longer titles in the sidebar can be naturally broken on the dot (.), so it might be worth inserting <wbr> tags instead of relying on different browser's line-wrapping algorithms.
They would have to be inserted during the server-side rendering of the markup (here).
Something like:

Array.from($("code"))
  .map(e => $(e))
  .forEach(e => e.html(e.html().replace(/\./g, "<wbr>.")))

Before:
image

After:
image

@ddbeck
Copy link
Contributor

ddbeck commented Oct 22, 2021

I think mdn/content#9612 is the same issue as this one. There's some additional detail and screenshots there, if needed.

@ddbeck ddbeck changed the title Issue with "Array.prototype.reduce()": (short summary here please) Sidebar text can overlap content Oct 22, 2021
@github-actions github-actions bot added the 🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. label Dec 9, 2021
rafae2k added a commit to rafae2k/yari that referenced this issue Dec 26, 2021
Fixes mdn#5031, mdn#5105, mdn#4635, #4973

Changes proposed in this pull request:

- Fix content overflow of links within sidebar component keeping icon and link inline
- Add  property ```word-break: break-all``` to ```.sidebar li``` class
@caugner caugner added the sidebar/toc Sidebar and table of contents label Mar 2, 2022
@schalkneethling
Copy link

@teoli2003 Can you have a look and see if this is still a problem with the new design? Thanks!

@teoli2003
Copy link
Contributor

So the overlapping is not happening anymore (but I think it was before the redesign).
The comment about MDN not breaking at the dot, but before is still valid. I don't know if you wanted to change this with the redesign or not. Anyway, the original report (left sidebar overlapping text) is fixed.

Capture d’écran 2022-03-03 à 12 34 16

@schalkneethling
Copy link

So the overlapping is not happening anymore (but I think it was before the redesign). The comment about MDN not breaking at the dot, but before is still valid. I don't know if you wanted to change this with the redesign or not. Anyway, the original report (left sidebar overlapping text) is fixed.

Thank you for getting back to me @teoli2003. There is a PR to address the new issue you mentioned. I will close this one as the specific issue mentioned here is no resolved.

Repository owner moved this from Backlog to Done in Yari Platform Engineering Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐌 idle Issues and PRs without recent activity. Flagged for maintainer follow-up. sidebar/toc Sidebar and table of contents
Projects
Development

No branches or pull requests

6 participants