Repository navigation
Conversation
The image and video insert modals render the media preview inside the modal body. A tall image pushes the preview past the modal and moves the Cancel/Insert buttons out of reach, with no way to scroll to them. Pass the existing NewModal scrollable prop so content is capped at max-content-height and scrolls, keeping the buttons reachable. Fixes modrinth#4256
Contributor
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
Member
|
slop |
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.
fix(ui): scroll tall media previews in markdown editor modals
Fixes #4256
Problem
The image and video insert modals in the markdown editor render the media preview inside the modal body via
.markdown-body-wrapper.NewModal's non-scrollable branch has no height cap, so uploading a tall image (e.g. 612x690) grows the preview past the modal and pushes the Cancel/Insert buttons out of the viewport, with no way to scroll to them — the image cannot be inserted at all.Fix
Pass the existing
scrollableprop toNewModalfor the image and video modals. The scrollable branch caps the content atmax-content-heightand makes it scrollable, so the buttons stay reachable. This is the intended pattern —NewModalhas aTODO: migrate all modals to use scrollable and remove this prop, andContentInstallModal,ProjectEnvironmentModalandMultiStageModalalready use it.Scope: image + video modals only (the two with media previews that can grow tall; the link modal previews a text link and is unaffected).
Verification
prettier --checkpasses on the changed file.eslinton the changed file: 0 errors (4 pre-existingv-htmlwarnings on untouched lines).turbocouldn't runpnpm prepr:frontend:liblocally — the repo's turbo.jsonc requires a newer turbo than the one in this environment's pnpm store (store has 2.8.2). The underlyingfixscript tasks (eslint --fix + prettier --write) were run directly on the changed file instead.Checklist
packages/ui/AGENTS.md)Branch:
fix/4256-markdown-editor-modal-scroll— 1 commit, 1 file, +12/−2.