Skip to content

fix: avoid extra scrollbar when having no appbar or sidebar#477

Merged
maartenbreddels merged 2 commits intomasterfrom
fix_extra_scollbar_minimal
Feb 23, 2024
Merged

fix: avoid extra scrollbar when having no appbar or sidebar#477
maartenbreddels merged 2 commits intomasterfrom
fix_extra_scollbar_minimal

Conversation

@maartenbreddels
Copy link
Copy Markdown
Contributor

This issue was introduced in 3884d6a and was caused by a full height 100% chain and a single element with padding, causing the solara-autorouter-content to be pushed down and creating scrollbars on its parents.
If instead, we add the scrollbar to the solara-autorouter-content element, we can avoid this issue.

See
image

where the anonymous div is causing scrollbars, and the solara-autorouter-content causes overflow.

The v-input has a top-margin of 4, triggering this.

After this fix, we don't see overflow and scrollbars:
image

This issue was introduced in 3884d6a
and was caused by a full height 100% chain and a single element with
padding, causing the solara-autorouter-content to be pushed down
and creating scrollbars on its parents.
If instead, we add the scrollbar to the solara-autorouter-content
element, we can avoid this issue.

.solara-autorouter-content {
height: 100%;
overflow: auto;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to cause a different issue:
image
Another, more different scroll bar

Copy link
Copy Markdown
Collaborator

@iisakkirotko iisakkirotko Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cause seems to be the fact that the 8px margins on the Card, together with height/width 100% push it beyond the bounds of the element containing it...

Actually, taking a better look at this, it seems to be caused by a margin of -12px from .row, in this case specifically the one that also has .solara-page-content-search.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also causes this to happen with .markdown-output cells
image

@iisakkirotko
Copy link
Copy Markdown
Collaborator

A soft way to solve this would be to add some conditionality to the -12px margins,

.row.solara-content-main{
    margin: 0;
}
.row.solara-autorouter-content{
    margin: 0;
}

Another approach would be to override the margins alltogether

div.row{ /* add div for specificity */
    margin: 0;
}

Setting height: 100% can still get bigger than 100% by it's content,
using max-height fixes this.
@maartenbreddels
Copy link
Copy Markdown
Contributor Author

Magic fix by Mario ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants