Skip to content

Commit 9c94380

Browse files
committed
netpyne-103 Fix "next" button display
1 parent ffcd89c commit 9c94380

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

webapp/components/general/TutorialBubble.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ const TutorialBubble = ({
6767
return null;
6868
}
6969

70+
const nextTourStep = steps[requestedTourStep];
71+
const { target: nextTarget } = nextTourStep? nextTourStep: {target: undefined};
72+
7073
const { target, title, content } = tourStep;
7174

7275

7376
const DOMtarget = getDOMTarget(target, tourStep);
77+
const nextDOMtarget = getDOMTarget(nextTarget, nextTourStep);
7478
const visible = DOMtarget?.checkVisibility();
7579

7680
if (!visible) {
@@ -141,6 +145,7 @@ const TutorialBubble = ({
141145
const { x, y } = calculateVisiblePosition(targetRect, 150, 300);
142146

143147
const hasOtherSteps = requestedTourStep < steps.length;
148+
const nextIsVisible = nextDOMtarget?.checkVisibility();
144149

145150
return (
146151
<div>
@@ -242,7 +247,7 @@ const TutorialBubble = ({
242247
>
243248
{hasOtherSteps ? 'Skip' : 'Close'}
244249
</Button>
245-
{hasOtherSteps
250+
{(hasOtherSteps && nextIsVisible)
246251
&& (
247252
<Button
248253
onClick={listen}

0 commit comments

Comments
 (0)