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

Fix overflow and text-wrapping behaviour of tooltip #5275

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/css/editor-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,13 @@ module.exports = `
font-weight: normal;
letter-spacing: normal;
pointer-events: none;
max-height: 150px;
overflow-y: auto;
overflow-x: hidden;
}

.ace_tooltip * {
text-wrap: wrap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Browser support for text-wrap seems limited, can we get the same behavior in a way with better browser support?

Copy link
Member

@nightwing nightwing Aug 4, 2023

Choose a reason for hiding this comment

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

I'd say this rule should be removed and white-space: pre; in the rule before should be changed to pre-wrap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately it wouldn't help with cases when non-breakable text is inside pre tag, because modern browsers (at least Chrome is doing that) are providing text-wrap: nowrap; for pre tag by default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

screen-capture.33.webm

Copy link
Contributor

Choose a reason for hiding this comment

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

@mkslanc can we have both of the options above combined, so if we are in an older browser white-space: pre-wrap would do the trick?

}

.ace_tooltip.ace_dark {
Expand Down
Loading