Skip to content

fix(ui): scroll tall media previews in markdown editor modals - #7924

Closed
avelev99 wants to merge 1 commit into
modrinth:mainfrom
avelev99:fix/4256-markdown-editor-modal-scroll
Closed

avelev99 wants to merge 1 commit into
modrinth:mainfrom
avelev99:fix/4256-markdown-editor-modal-scroll

Conversation

@avelev99

Copy link
Copy Markdown

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 scrollable prop to NewModal for the image and video modals. The scrollable branch caps the content at max-content-height and makes it scrollable, so the buttons stay reachable. This is the intended pattern — NewModal has a TODO: migrate all modals to use scrollable and remove this prop, and ContentInstallModal, ProjectEnvironmentModal and MultiStageModal already 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 --check passes on the changed file.
  • eslint on the changed file: 0 errors (4 pre-existing v-html warnings on untouched lines).
  • Note: turbo couldn't run pnpm prepr:frontend:lib locally — the repo's turbo.jsonc requires a newer turbo than the one in this environment's pnpm store (store has 2.8.2). The underlying fix script tasks (eslint --fix + prettier --write) were run directly on the changed file instead.

Checklist

  • Code follows the repo style (tabs, no new comments)
  • No new dependencies
  • No Storybook change needed (prop/styling-level change per packages/ui/AGENTS.md)

Branch: fix/4256-markdown-editor-modal-scroll — 1 commit, 1 file, +12/−2.

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
@github-actions

Copy link
Copy Markdown
Contributor

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@IMB11

IMB11 commented Oct 10, 2026

Copy link
Copy Markdown
Member

slop

@IMB11 IMB11 closed this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

The upload image pop-up modal breaks when trying to upload "tall" images, does not support scrolling and the preview obstructs the insert button.

2 participants