fix: split view / raw markdown editor can't scroll in fullscreen (#1088) - #1228
Open
cycsmail wants to merge 1 commit into
Open
fix: split view / raw markdown editor can't scroll in fullscreen (#1088)#1228cycsmail wants to merge 1 commit into
cycsmail wants to merge 1 commit into
Conversation
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.
Fixes #1088.
In fullscreen editing the split-view and raw-markdown panes can't be scrolled, while IR and WYSIWYG work fine. The reason is that sv/raw render as a single
<pre class="vditor-sv vditor-reset">where the container and the editable surface are the same element, so the existing rulenever matches it (it's a descendant selector, but here
.vditor-resetsits on the same element as.vditor-sv). The element is left withoverflow: hiddenfrom the group above, so it clips instead of scrolling. IR/WYSIWYG nest a separate.vditor-resetinside their container, which is why they were unaffected.The fix adds a compound selector targeting that combined element so it scrolls itself:
Higher specificity than the
overflow: hiddengroup, so the sv/raw pane resolves tooverflow-y: auto. Non-fullscreen editing and IR/WYSIWYG are untouched.The repo has no CSS/DOM test harness, so I checked this with a small standalone cascade resolver that parses
vditor.cssand computes the effectiveoverflow-yfor the fullscreenpre.vditor-sv.vditor-reset: with the fix it resolves toauto, and after stripping the added rule it goes back tohidden, confirming the checker tracks the actual bug and not just my edit.