Skip to content

fix: EVER-14122 tooltip text wrap when using strings and width input#323

Merged
lihnick merged 4 commits intocision:masterfrom
lihnick:master
Jul 26, 2021
Merged

fix: EVER-14122 tooltip text wrap when using strings and width input#323
lihnick merged 4 commits intocision:masterfrom
lihnick:master

Conversation

@lihnick
Copy link
Copy Markdown
Collaborator

@lihnick lihnick commented Jul 14, 2021

No description provided.

@lihnick lihnick requested a review from pixelbandito July 14, 2021 21:18
white-space: nowrap;
word-wrap: none;
white-space: normal;
overflow-wrap: break-word;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white-space: normal wraps long sentences and overflow-wrap: break-word wraps long words

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause a visual issue when there's no tooltip width defined.
The reason we initially used white-space: nowrap is that, without a defined width, the tooltip contents will be constrained to the width of the trigger element.

Frequently the tooltip is a place to put a longer explanation for something like an icon button, where the trigger is very narrow. nowrap means, in those cases, a multi-word phrase like "Delete an influencer" would display in a one-line tooltip under the trashcan icon.

Copy link
Copy Markdown
Contributor

@pixelbandito pixelbandito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make the new styles conditional, only when the tooltip has a defined width?

white-space: nowrap;
word-wrap: none;
white-space: normal;
overflow-wrap: break-word;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will cause a visual issue when there's no tooltip width defined.
The reason we initially used white-space: nowrap is that, without a defined width, the tooltip contents will be constrained to the width of the trigger element.

Frequently the tooltip is a place to put a longer explanation for something like an icon button, where the trigger is very narrow. nowrap means, in those cases, a multi-word phrase like "Delete an influencer" would display in a one-line tooltip under the trashcan icon.

Copy link
Copy Markdown
Contributor

@pixelbandito pixelbandito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@lihnick lihnick merged commit 79ba3ae into cision:master Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants