Skip to content

Commit 5c6728c

Browse files
committed
render title via tooltipcontent
1 parent 3471c05 commit 5c6728c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

example/html-tooltip/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ <h4>Section Six</h4>
7575
intro.setOptions({
7676
steps: [
7777
{
78+
title: '<p>Welcome</p>',
7879
element: '#step1',
7980
intro: "This is a <b>bold</b> tooltip."
8081
},

src/packages/tour/components/TourTooltip.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,17 +328,22 @@ const Buttons = ({
328328

329329
const Header = ({
330330
title,
331-
332331
skipLabel,
332+
renderAsHtml,
333333
onSkipClick,
334334
}: {
335335
title: string;
336-
337336
skipLabel: string;
337+
renderAsHtml?: boolean;
338338
onSkipClick: (e: any) => void;
339339
}) => {
340+
const titleEl = TooltipContent({
341+
text: title,
342+
tooltipRenderAsHtml: renderAsHtml,
343+
className: tooltipTextClassName,
344+
});
340345
return div({ className: tooltipHeaderClassName }, [
341-
h1({ className: tooltipTitleClassName }, title),
346+
h1({ className: tooltipTitleClassName }, titleEl),
342347
Button({
343348
className: skipButtonClassName,
344349
label: skipLabel,
@@ -452,7 +457,7 @@ export const TourTooltip = ({
452457
const text = step.intro;
453458
const position = step.position;
454459

455-
children.push(Header({ title, skipLabel, onSkipClick }));
460+
children.push(Header({ title, skipLabel, renderAsHtml, onSkipClick }));
456461

457462
children.push(
458463
TooltipContent({

0 commit comments

Comments
 (0)