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

Make selectors Storybook 8 compatible #81

Merged
merged 1 commit into from
Dec 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading