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

Fix inconsistent transition by backward navigation via presenter view #455

Merged
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed

- [Experimental transition] Fix inconsistent transition by backward navigation via presenter view ([#452](https://github.com/marp-team/marp-cli/issues/452), [#455](https://github.com/marp-team/marp-cli/pull/455))
- Preview mode has unexpected message in the information bar "You are using an unsupported command-line flag" ([#453](https://github.com/marp-team/marp-cli/issues/453), [#454](https://github.com/marp-team/marp-cli/pull/454))

## v2.0.0 - 2022-05-24
Expand Down
7 changes: 4 additions & 3 deletions src/templates/bespoke/transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ const bespokeTransition = (deck) => {
return false
}

// Check condition
// (The conditional function may modify event object so should be called at first of checks)
if (!cond(e)) return true

// Check transition
const current = deck.slides[deck.slide()]
const isBack = () => e.back ?? back
Expand All @@ -124,9 +128,6 @@ const bespokeTransition = (deck) => {
)
if (!section) return true

// Check condition
if (!cond(e)) return true

// Parse settings
const transitionData = parseTransitionData(
section.getAttribute(transitionDataTarget) ?? undefined
Expand Down