question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using Max-height and max-width in global CSS class[Bug]

See original GitHub issue

Describe the bug I set a global Class parameter to a custom CSS format and tried with max-width and max-height properties, but it gave me a weird, half-translucent modal. The modal is greyed out, and if I click on anything it closes the modal. I can’t interact with the modal The header for the modal is also in the wrong spot, off to the left of the content

To Reproduce Steps to reproduce the behavior:

  1. In Apps.razor set <CascadingBlazoredModal ContentScrollable="true" Class="custom-modal-class">
  2. In site.css add
.custom-modal-class {
    max-width: 90%;
    max-height: 90%;
}
  1. Open modal

Expected behavior My goal is to have max height set to 95% and the scroll bars for anything taller than that. I’d ideally also like to have max width at 80% and then wrap content as necessary. Last resort is having horizontal scoll bars.

Screenshots With max parameters set, showing bug. Note that the header, which says “IssuePopup Blazored” is off to the left of the body of the modal With Max Size Parameters

Without parameters, showing modal normally without max size parameters

Hosting Model (is this issue happening with a certain hosting model?):

  • Blazor Server

Additional context To be honest, my CSS skills are pretty light. I’m willing to bet that the issue is me 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
aterbocommented, Nov 24, 2021

Yeah, if there were some sort of programmatic enforcement, it would definitely need to allow the developer to overwrite or remove properties as they prefer, as long as they know what needs to be included. If you would prefer just to update the wiki, totally fine.

I think the main concern is to inform users that there are styles that are necessary to keep the modal from breaking, and these all needed to be provided in any custom class since the code will overwrite all defaults.

  • display: flex; (needed to keep default header alignment)
  • flex-direction: column;
  • z-index: 102; (needs to be higher than other classes for visibility)
  • background-color: #fff; (or any background)

If you want, I’m happy to write an update to the wiki clarifying this and provide it as a PR.

For the max height, I think I pointed you at the wrong thing. My fault. I’ll take another look at it and get back to you.

0reactions
larsk2009commented, Nov 24, 2021

I don’t think we should enforce anything when settings a custom class, as it is up to the implementing developer to decide how they want to style the modal. If we enforce it but a developer doesn’t want to use that specific property, then what should they do? Or if we only overwrite and keep the basis, what if they want to remove something from that basis?

I do agree it might be a good idea to clarify this in the documentation if it is unclear.

I can’t find the max-height thingy which you say is the examples, but that is probably me. Where exactly should I be looking?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with max-height not working in css grid element
It is because the container blue is saying my height is dependent on my children(because of fit-content). When you set height:100% you say...
Read more >
Bug RE: width, max-width, and height CSS : Site Feedback
I am hoping that there might be a way to globally fix this with all images on all pages with a global CSS...
Read more >
max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >
CSS: “max-width”: “auto” is not a “max-width” value.
The error message is saying that the value auto is not a valid value for the sizes attribute. To fix this issue, you...
Read more >
NO BUG: [class*="brxe-"] max-width 100% is too intrusive
By default, Bricks sets all Bricks elements to max-width 100% by default. It uses this statement to do it: [class*="brxe-"] { max-width: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found