-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wrap table cell contents instead of CSS truncation #482
Wrap table cell contents instead of CSS truncation #482
Conversation
This allows table cell contents to wrap to a new line instead of overflowing the cell's max width, and will also force line breaks on strings of text that are too long without a natural break.
@iangreenleaf Can you provide a screenshot where it’s not working and indicate what browser you’re using? I’m not sure I’m seeing the issue in my environment. Also, can you provide a screenshot of the outcome of this change? Finally, a couple notes on the CSS:
|
@tysongach funny, someone edited my entry in the demo app, probably because it was breaking the tables an annoying them. It's hard to show the problem on the demo app because the text fields are being truncated by Rails, but here are some screenshots at just the right width, before and after wrapping: While testing this, I also discovered that the |
The word-wrap property doesn't help unless the column width is fixed, so return this to close to the default.
Ah hah! I couldn't work out why @tysongach couldn't see this. We truncate text fields by default to I can confirm that if you push it up to something along the lines of |
* Wrap table cell contents instead of CSS truncation This allows table cell contents to wrap to a new line instead of overflowing the cell's max width, and will also force line breaks on strings of text that are too long without a natural break. * Remove table wrapping CSS The word-wrap property doesn't help unless the column width is fixed, so return this to close to the default.
* 'master' of https://github.com/thoughtbot/administrate: Tweak primary navigation (thoughtbot#861) Redesign focus outline styles (thoughtbot#863) Localise Dates (thoughtbot#570) Wrap unsupported form field notes in proper divs (thoughtbot#515) Update customizing_dashboards.md (thoughtbot#568) Wrap table cell contents instead of CSS truncation (thoughtbot#482) Remove worker from Procfile (thoughtbot#854) Remove dependency from ActionMailer (thoughtbot#851) Release version 0.6.0. Remove delayed_job_active_record dependency (thoughtbot#845) use the association includes in the has_many resources as well move include work to an association includes improve performance for n+1s
* Wrap table cell contents instead of CSS truncation This allows table cell contents to wrap to a new line instead of overflowing the cell's max width, and will also force line breaks on strings of text that are too long without a natural break. * Remove table wrapping CSS The word-wrap property doesn't help unless the column width is fixed, so return this to close to the default.
I'm not sure what discussion led to this being added since the ticket referenced in ae61171 isn't public. However, I don't like the existing solution because:
Field::Text
type already offers truncation with ellipsis, so it duplicates logic to also perform that here. If someone sets a truncation value in their dashboard, they shouldn't have to fiddle with the CSS to have their chosen length respected.This changes table cells to wrap normally, and to force line breaks on super long strings that don't have a natural break.