fix(client): hide goto dialog suggestions when dialog is closed#2597
Merged
kermanx merged 1 commit intoMay 17, 2026
Merged
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
kermanx
approved these changes
May 17, 2026
@slidev/client
create-slidev
create-slidev-theme
@slidev/parser
@slidev/cli
@slidev/types
commit: |
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.
Summary
Hide the goto dialog's autocomplete suggestions list when the dialog itself is in its closed state, so the list cannot leak into the viewport while the dialog wrapper is offscreen.
Fixes #2593
Background
The dialog wrapper toggles between
top-5and-top-20based onshowGotoDialog. The wrapper has no height constraint and nooverflow: hidden, so its content can extend back into the viewport. The autocomplete list inside the wrapper renders wheneverresult.length > 0, which depends ontext- independently of the dialog's own open/closed state.If those two pieces of state ever drift (the dialog flips to closed while
textstill has content), the list keeps rendering and the wrapper grows tall enough that the list spills below the-top-20offset, exactly as observed in #2593 (#slidev-goto-dialog.-top-20withheight~666px and an.autocomplete-liststill mounted).Fix
Add
showGotoDialogto the list'sv-ifso the autocomplete list only renders while the dialog is in its open state. The list visibility now depends tautologically on the dialog's state — there's no path where the wrapper is in its closed position and the list is still mounted.Test plan
pnpm eslint packages/client/internals/Goto.vue --cache— clean.pnpm exec vue-tsc --noEmit --skipLibCheck— no diagnostics inpackages/client(preexisting unrelated diagnostics indocs/node_modules/vitepressonly).pnpm -C demo/starter run build— clean.pnpm demo:dev:g, type a query → suggestions list appears as expected;top: -80pxand the list is unmounted (previously remained rendered below the offset whenevertextwas non-empty at close-time);g→ text and selection are reset by the existing watcher, list hidden until a new query is typed.textreset inclose(): with the previousv-if="result.length > 0"the wrapper got-top-20while.autocomplete-liststayed mounted (matching the issue's DOM snapshot); with the newv-ifit does not.