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

Slidetransitionend event misses reference to previousSlide when history == true #3079

Closed
Martinomagnifico opened this issue Nov 23, 2021 · 4 comments

Comments

@Martinomagnifico
Copy link
Collaborator

The “Slidetransitionend” event misses the reference to “previousSlide” when history == true.
When history is false, it just works, but when we set it to true in the config, the previousSlide is null. Seems like a bug to me 😀.

@Martinomagnifico
Copy link
Collaborator Author

See this pen: https://codepen.io/martino/pen/dyzEagK

@hakimel
Copy link
Owner

hakimel commented Nov 24, 2021

I can see the issue on CodePen but when I use the same code in a local copy of reveal previousSlide is set 🤷‍♂️

This is the presentation I tested:

<html>
	<head>
		<link rel="stylesheet" href="dist/reset.css">
		<link rel="stylesheet" href="dist/reveal.css">
		<link rel="stylesheet" href="dist/theme/black.css">
	</head>
	<body>
		<div class="reveal">
			<div class="slides">
				<section>One</section>
				<section>Two</section>
			</div>
		</div>

		<script src="dist/reveal.js"></script>
		<script>
			Reveal.initialize({
				histroy: true
			});

			Reveal.on( 'slidechanged', event => {
				console.log(event.type)
				console.log( event.previousSlide );
			});

			Reveal.on( 'slidetransitionend', event => {
				console.log(event.type)
				console.log( event.previousSlide );
			});
		</script>
	</body>
</html>

@Martinomagnifico
Copy link
Collaborator Author

Martinomagnifico commented Nov 24, 2021

There is a typo: histroy > history

@hakimel
Copy link
Owner

hakimel commented Nov 24, 2021

Thanks for spotting that! This issue has been fixed.

stefanocampanella pushed a commit to stefanocampanella/reveal.js that referenced this issue Mar 1, 2022
srwohl pushed a commit to srwohl/phantom-pres that referenced this issue Sep 2, 2024
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

3 participants
@Martinomagnifico @hakimel and others