-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 dict attributes #18290
Wrap dict attributes #18290
Conversation
@joshmcrty May be add "font-family" here?
|
tbh, I am no sure whether it is the fact we have a longer attribute, or we have an attribute in a dictionary . If the former, we might need to open a dedicated issue for this font issue? |
For this case it does not show a monospace font.
I'll probably open a PR - if the author of the latest change will not do it himself. |
@joshmcrty frontend/src/components/ha-attributes.ts Line 128 in a5e5efa
These attributes give both a correct font & a wrapping. |
@ildar170975 thanks for looking into this further. I'm guessing that when |
I also wondered what that
even may be instead of the code added by you? |
Proposed change
This lets the
<pre>
element used fordict_attr
wrap long text instead of breaking out of its container when viewing sensor attributes, for example, in a more info dialog. Simply wrapping the text will ensure that all of the information is visible, but it could become difficult to read for very large blocks of text as seen in #18027.This also removes the default margins on the
<pre>
element to be consistent with how other attribute values are displayed.A couple of other ways to fix this could be to use
text-overflow: ellipsis
and eitheroverflow: hidden
oroverflow-x: auto
, or even offer some kind of "view more" button that pops up a separate, larger dialog with just that text to give it more room to be viewed.Before:
After:
With
text-overflow: ellipsis
andoverflow-x: auto
:Type of change
Example configuration
This is borrowed from the issue linked below
Additional information
Checklist