Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
make selectors storybook 8 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Dec 27, 2023
1 parent 8f95282 commit dc9d5ea
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/features/GuidedTour/GuidedTour.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import React, { useEffect, useMemo, useState } from "react";
import Joyride, { CallBackProps, STATUS } from "react-joyride";
import { API } from "@storybook/manager-api";
import { UPDATE_STORY_ARGS } from "@storybook/core-events";
Expand Down Expand Up @@ -34,6 +34,11 @@ export function GuidedTour({
});
}, []);


const storyPlaygroundElement = useMemo(() => {
return (document.querySelector("#root div[role=main]") || document.querySelector("#storybook-panel-root")) as HTMLElement
}, [])

const steps: GuidedTourStep[] = isFinalStep
? [
{
Expand Down Expand Up @@ -100,7 +105,7 @@ export function GuidedTour({
},
},
{
target: "#root div[role=main]",
target: storyPlaygroundElement,
title: "Interactive story playground",
content: (
<>
Expand Down

0 comments on commit dc9d5ea

Please sign in to comment.