Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CodeSurfer animations briefly flash all at once when entering a slide #738

Open
micheleb opened this issue Jul 24, 2020 · 0 comments
Open

Comments

@micheleb
Copy link

Hi!

First of all, thanks for the great tool! :)

I found an issue with the latest (4.1.1) version of mdx-deck, and I'm also submitting a PR to fix it.

If you have a slide with a <Steps> component before a slide with a (multi-step) <CodeSurfer> component, as soon as the slide with the <CodeSurfer> component is loaded, you'll see all CodeSurfer animations played back in reverse, very quickly.

To see this happen, install CodeSurfer in the demo project, and add these two slides to demo.mdx:

---

# Steps

<Steps>

- these
- are
- some
- steps

</Steps>

---

# CodeSurfer

<CodeSurfer>

```js
console.log("hey!");
```

```js
console.log("hey!");
console.log("I'm a test");
```

```js
console.log("hey!");
console.log("I'm a test");
console.log("for CodeSurfer");
```

```js
console.log("See all those animations at the beginning?");
```

```js
console.log("they shouldn't show up");
```

</CodeSurfer>

---

I'm creating a new PR to fix this behaviour. It worked for me, but I don't know if it's the best way to fix it :)

micheleb added a commit to micheleb/mdx-deck that referenced this issue Jul 24, 2020
Reset steps before resetting page index on context.next(), so that
CodeSurfer doesn't render all animations from its last step to step 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant