Repository navigation
Clear the active question on Slidev 51 too - #6
Merged
Merged
Conversation
0.5.0 took the slide number from the onSlideEnter/onSlideLeave arguments. Slidev 52 passes (to, from); 0.50 and 51 call the hooks with none, so the leave hook's from was always undefined and the question was never cleared: phones kept showing it after the presenter moved on. Both layouts now call useActiveQuestion(), which uses the slide's own number from useSlideContext().$page and holds the activation rules in one place. A quiz slide with missing fields registers no question, so it no longer activates one on enter either. The debug skill names the symptom and the fix.
irinanazarova
force-pushed
the
slidev-51-slide-numbers
branch
from
October 7, 2026 11:49
f9db0a9 to
d14fdb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The addon declares support for Slidev >= 0.50, but 0.5.0 reads the slide number from the
onSlideEnter/onSlideLeavecallback arguments. Slidev 52 passes(to, from); Slidev 0.50 and 51 call the hooks with no arguments. On those versions the leave hook'sfromis alwaysundefined, so the question is never cleared and phones keep showing it after the presenter leaves the slide.useActiveQuestion()composable inuseQuizManager.ts. It takes the slide's own number fromuseSlideContext().$page, which every supported version provides, and holds the activate-on-mount, activate-on-enter and "clear only if this slide set it" rules in one place.setActiveandclearActivehad no other callers and are gone.quizslide with missing fields registers no question, so it no longer activates one on enter either.How to verify
npm testandtscpass.activeQuestionIdfrom each sync:nulleverywhere else, in both directions.Checklist
npm testpasses