diff --git a/src/styles/global.scss b/src/styles/global.scss index b705e5f..5e918fe 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -34,6 +34,11 @@ pointer-events: none; transition-duration: 350ms; + span { + line-height: 1.2; + white-space: pre-line; + } + .alextras--tooltip-arrow { position: absolute; bottom: -9px; diff --git a/src/utils/Helpers.ts b/src/utils/Helpers.ts index 53c50f0..a402bb1 100644 --- a/src/utils/Helpers.ts +++ b/src/utils/Helpers.ts @@ -565,7 +565,11 @@ export const createTooltip = (target: HTMLElement, contents: string) => { styles: { top: `${target.offsetTop - 15}px`, }, - textContent: contents, + children: [ + createElement('span', { + textContent: contents.trim(), + }), + ], }); const tooltipArrow = createElement('div', {