Skip to content

Commit 0208aca

Browse files
authored
Merge pull request #2126 from Parvinmh/bugFix/hideButton
fix: hideNext now correctly hides the Next button on last step
2 parents c11773f + c807e0e commit 0208aca

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

example/html-tooltip/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ <h4>Section Six</h4>
7373
function startIntro(){
7474
var intro = introJs.tour();
7575
intro.setOptions({
76+
hideNext: true,
7677
steps: [
7778
{
7879
title: '<p>Welcome</p>',

src/packages/tour/components/TourTooltip.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ const NextButton = ({
177177
}) => {
178178
const isFullButton = currentStep === 0 && steps.length > 1 && hidePrev;
179179
const isLastStep = currentStep === steps.length - 1 || steps.length === 1;
180+
const isHidden = isLastStep && hideNext;
180181

181182
const isDisabled = dom.derive(() => {
182183
// when the current step is the last one or there is only one step to show
@@ -205,6 +206,9 @@ const NextButton = ({
205206
classNames.push(fullButtonClassName);
206207
}
207208

209+
if (isHidden) {
210+
classNames.push(hiddenButtonClassName);
211+
}
208212
return classNames.filter(Boolean).join(" ");
209213
},
210214
});

0 commit comments

Comments
 (0)