fix: fill the fullscreen component editor with the editor - #3211
fix: fill the fullscreen component editor with the editor#3211ihor-romaniuk wants to merge 4 commits into
Conversation
Expanding the component editor to fullscreen left the block sitting in the top 70% of the modal with empty space beneath it, and a block taller than the modal could not be reached at all: the frame was sized to the height the block reports, so flexbox shrank it while the modal itself does not scroll. In fullscreen the frame now stretches to whatever height the modal leaves it and a tall block scrolls inside it. The sized modal keeps sizing the frame to the block, as before.
Expanding the text or game editor to fullscreen left the writing area where it was, with a band of empty space between it and the footer: the editor body is sized to three quarters of the modal body, and TinyMCE resolves its own height once when it is built and then keeps that value in an inline style. In fullscreen the modal body now hands its height down the column, so the editor body fills it and TinyMCE follows. Editors taller than the modal keep scrolling, now inside the body content rather than the body itself. The sized modal is unchanged.
|
Thanks for the pull request, @ihor-romaniuk! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3211 +/- ##
=======================================
Coverage 95.92% 95.92%
=======================================
Files 1397 1397
Lines 33581 33587 +6
Branches 7947 7951 +4
=======================================
+ Hits 32214 32220 +6
Misses 1308 1308
Partials 59 59 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Two component editors do not use the space they are given when expanded to fullscreen. The text and game editors leave a band of empty page between the writing area and the footer. The editor for blocks without a dedicated editor — anything advanced, reached from a direct editor link — shows the block in the top 70% of the modal with empty space beneath it, and a block taller than the modal cannot be reached at all.
Both now fill the modal in fullscreen: the writing area grows with the page, and a block taller than the modal scrolls inside its frame. Neither editor changes at its normal size.
Implementation notes
LibraryBlocksizes its IFrame to the height the block reports, with a70vhfloor. In a fullscreen modal that is a fixed height inside a fixed-height flex column, so it neither grows into the space nor overflows into a scroll — flexbox shrinks it instead and the modal itself does not scroll. The newfillContainerprop swaps that for a growing flex item, andAdvancedEditorsets it only in fullscreen. It is opt-in because outside a flex parent the item would collapse to the IFrame default of 150px..editor-bodycarries anh-75utility, and TinyMCE resolves itsheight: '100%'once when it is built and keeps that pixel value in an inline style. A definiteflex-basisoutranks both, which is why the stylesheet needs no!important.EditorContainer/index.scssexisted but was never imported; it is imported now, and the modal carries aneditor-modalclass so the rules do not reach every fullscreen Paragon modal in the app..pgn__modal-body-contentgetsoverflow-y: autobecause bounding it takes scrolling away from the modal body, and the problem editor is routinely taller than the modal.Screenshot/Video
Testing
Preconditions: a course with an HTML component, a problem, and any advanced component such as a poll.
/authoring/course/<courseId>/editor/poll/<blockId>, and expand it.Verified locally
jeston the editor suitesfillContainerline fails exactly the new testtsc,dprint,oxlint,stylelint