Skip to content

Commit

Permalink
Merge pull request #45 from storybookjs/fix/control-toggle-step
Browse files Browse the repository at this point in the history
Use the correct event to detect args change
  • Loading branch information
yannbf authored Jun 8, 2023
2 parents 43491e1 + e8c20d9 commit ac7ecc6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/features/GuidedTour/GuidedTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Joyride, { CallBackProps, STATUS, Step } from "react-joyride";
import { PulsatingEffect } from "../../components/PulsatingEffect/PulsatingEffect";
import { Confetti } from "../../components/Confetti/Confetti";
import { API } from "@storybook/manager-api";
import { STORY_ARGS_UPDATED } from "@storybook/core-events";
import { UPDATE_STORY_ARGS } from "@storybook/core-events";
import { Tooltip } from "./Tooltip";

type GuidedTourStep = Step & { hideNextButton?: boolean };
Expand All @@ -21,7 +21,7 @@ export function GuidedTour({
const [stepIndex, setStepIndex] = useState<number>();

useEffect(() => {
api.once(STORY_ARGS_UPDATED, () => {
api.once(UPDATE_STORY_ARGS, () => {
setStepIndex(3);
});
}, []);
Expand Down Expand Up @@ -124,9 +124,7 @@ export function GuidedTour({
floaterProps={{
styles: {
floater: {
padding: 0,
paddingLeft: 8,
paddingTop: 8,
padding: "8px 0 0 8px",
filter:
"drop-shadow(0px 5px 5px rgba(0,0,0,0.05)) drop-shadow(0 1px 3px rgba(0,0,0,0.1))",
},
Expand Down

0 comments on commit ac7ecc6

Please sign in to comment.