fix: override NcAppContent flex-basis to fix square iframe on mobile portrait#65
Open
PawelZera wants to merge 1 commit intorotdrop:masterfrom
Open
fix: override NcAppContent flex-basis to fix square iframe on mobile portrait#65PawelZera wants to merge 1 commit intorotdrop:masterfrom
PawelZera wants to merge 1 commit intorotdrop:masterfrom
Conversation
On narrow (portrait) screens NcAppContent (@nextcloud/vue) receives `flex-basis: 100vw` from its scoped style. When the parent flex container is a column, flex-basis governs the *height* axis, so `main#app-content-vue` ends up with height ≈ viewport-width, producing an almost-square iframe (e.g. 466 × 482 px on a 482 × 835 screen). RoundCubeWrapper already uses a ResizeObserver that faithfully copies the container dimensions onto the iframe via inline style, so the square propagates all the way to the Roundcube iframe. Fix: add a scoped :deep() override that resets flex-basis to `auto` and forces `flex: 1 1 auto` on the content container so it fills the available height correctly on all screen sizes.
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.
Problem
On narrow portrait screens (e.g. phone held vertically), the embedded Roundcube iframe appears almost square instead of filling the available height.
Root cause
NcAppContentfrom@nextcloud/vueapplies a scoped style:The
.app-containerinApp.vueusesflex-direction: column, soflex-basisgoverns the height axis. On a 482 × 835 device this givesmain#app-content-vuea computed height of ~482 px (= viewport width), yielding an almost-square content area.RoundCubeWrapperthen uses aResizeObserverthat faithfully copies container dimensions onto the iframe via inlinestyle.width/height, so the square propagates all the way to the<iframe>.Debugging evidence (Edge DevTools on mobile)
After manually setting
flex: 1 1 auto; flex-basis: autoonmain#app-content-vuein DevTools the layout immediately recovered to full height (835 px), confirming the cause.Fix
Add a scoped
:deep()override inApp.vuethat resetsflex-basistoautoand enforcesflex: 1 1 autoon the content container:This is intentionally scoped to the app-specific class so it does not interfere with other Nextcloud apps.
Testing