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

"Resource label" overlaps "Resource value" when Layout is Responsive #1700

Closed
edimossilva opened this issue Jul 6, 2020 · 8 comments · Fixed by #1702
Closed

"Resource label" overlaps "Resource value" when Layout is Responsive #1700

edimossilva opened this issue Jul 6, 2020 · 8 comments · Fixed by #1702
Labels
feature new functionality that’s not yet implemented views-and-styles how administrate looks and is interacted with

Comments

@edimossilva
Copy link
Contributor

  • Scenario

    • On show resource page, when the layout is responsive and the row labels have many letters
  • Issue

    • row resource label overlaps resource value.
  • Example

  • image
  • Proposal

    • change the percentage of .attribute-label and .attribute-data from 15%-85% to 20%-80%
  • What versions are you running?

    • Rails - 6.0.0
    • administrate - 0.14.0
@edimossilva edimossilva added the bug breakages in functionality that is implemented label Jul 6, 2020
@sedubois
Copy link
Contributor

sedubois commented Jul 6, 2020

I would propose to add CSS to let the label wrap to the next line, otherwise fixing the width percentage might not work for all cases?

@Nucleotide
Copy link

I believe by looking at the 'Updated At' it does go to the next line. Long words without any breaks are always annoying.

@sedubois
Copy link
Contributor

sedubois commented Jul 6, 2020

Could you try adding overflow-wrap: break-word?

@nickcharlton nickcharlton added feature new functionality that’s not yet implemented views-and-styles how administrate looks and is interacted with and removed bug breakages in functionality that is implemented labels Jul 6, 2020
@nickcharlton
Copy link
Member

I'd +1 trying break-word. Do you think you could open a PR for this?

@betelgeuse
Copy link
Contributor

I'd +1 trying break-word. Do you think you could open a PR for this?

The thing to be aware of is languages like Finnish that regularly have long words. Any breaking in the middle of the word is less than ideal without adding hyphens in proper places.

@nickcharlton
Copy link
Member

That's a good point. Another reason to not use this is that break-word is also deprecated.

A better option might be to drop the value on a line below the label on smaller browser widths which would give us much more space to handle long/compound words.

@sedubois
Copy link
Contributor

sedubois commented Jul 7, 2020

overflow-wrap: break-word is not deprecated AFAIK. https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap.

@edimossilva
Copy link
Contributor Author

I believe that changing the percentage is a good approach considering that I will add a min-width to .main-content in #1699
So it is like the real width of .attribute-label will be increased and the real width of .attribute-data column will not be reduced.

@edimossilva edimossilva changed the title "Resource label" overlaps "Resource value" when Layout is Responsive #1699 "Resource label" overlaps "Resource value" when Layout is Responsive #1700 Jul 8, 2020
@edimossilva edimossilva changed the title "Resource label" overlaps "Resource value" when Layout is Responsive #1700 "Resource label" overlaps "Resource value" when Layout is Responsive Jul 8, 2020
edimossilva added a commit to edimossilva/administrate that referenced this issue Jul 8, 2020
edimossilva added a commit to edimossilva/administrate that referenced this issue Jul 8, 2020
edimossilva added a commit to edimossilva/administrate that referenced this issue Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new functionality that’s not yet implemented views-and-styles how administrate looks and is interacted with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants