Repository navigation
fix(ui): preserve line breaks in Info tooltip text - #3346
Closed
hpcnt-jerry-l wants to merge 1 commit into
Closed
hpcnt-jerry-l wants to merge 1 commit into
hpcnt-jerry-l wants to merge 1 commit into
Conversation
Info tooltip content is rendered via Svelte text interpolation, so \n characters reach the DOM as text. Default white-space: normal collapses them into a single line (and <br> cannot be used - Svelte escapes it). Add whitespace-pre-wrap to the tooltip <p> so multi-line tooltips keep their line breaks.
|
@hpcnt-jerry-l is attempting to deploy a commit to the Evidence Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Infotooltip text containing newlines renders as a single line — line breaks are collapsed by the defaultwhite-space: normal.Infotooltip content is rendered via Svelte text interpolation ({text}), so\ncharacters reach the DOM as text. Becausewhite-space: normalcollapses them into one line (<br>cannot be used — Svelte escapes it in text interpolation), multi-line tooltips (e.g. metric denominator explanations) become unreadable single lines. This change makes the tooltip preserve its line breaks.Changes
core/src/user-components/tags/info/Info.svelte: addwhitespace-pre-wrapto the tooltip<p>class. Pure CSS — no API or DOM changes.Testing
serve.user-componentshas no CSS-rendering test harness (jsdom does not apply stylesheet styles), and the change is a single CSS class.