Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modal] Setting blurring to true brings modal down intermittently. #1691

Closed
MrL1605 opened this issue Oct 2, 2020 · 2 comments
Closed

[Modal] Setting blurring to true brings modal down intermittently. #1691

MrL1605 opened this issue Oct 2, 2020 · 2 comments
Labels
lang/css Anything involving CSS

Comments

@MrL1605
Copy link
Contributor

MrL1605 commented Oct 2, 2020

Bug Report

If a modal with blurring set to true is opened, header (any fixed position content) shifts down according to the margin of non-fixed content.

Related issue in Semantic-UI which fixes the fixed contents. This was a permanent issue before and the fix was to restore the view after modal is closed as mentioned in the comment.

Right now I'm using a workaround by using padding instead of margin for the non-fixed content and it works beautifully.

Would like to know if fixing this is even possible in first place? If yes, I would like to contribute to fix this, if someone would give me a few hints on how to fix this.

Steps to reproduce

  • Open the modal with option "blurring: true".
  • All "position: fixed" contents shift in different ways.
  • Close the modal and everything looks fine again.

Expected result

Fixed header bar should remain on top.
2020-10-02 18 27 56 codepen io ef458389825c

Actual result

Fixed header bar comes down proportional to the margin of non-fixed content (ie. bigger the margin, more header goes down)
2020-10-02 18 28 11 codepen io bf8c1e26f294

Testcase

https://codepen.io/mrl1605-the-decoder/pen/MWyMLGa

Screenshot (if possible)

Attached above

Version

2.8.7

@MrL1605 MrL1605 added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Oct 2, 2020
@ko2in ko2in added lang/css Anything involving CSS and removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged labels Oct 2, 2020
@ko2in
Copy link
Member

ko2in commented Oct 2, 2020

As described in the CSS specification:

A value other than none for the filter property results in the creation of a containing block for absolute and fixed positioned descendants unless the element it applies to is a document root element in the current browsing context. The list of functions are applied in the order provided.

So, if you wrap the fixed element within a container, and the filter applies to the container, which results in the creation of another block for absolute and fixed positioned which thus shift your fixed and absolute element positions.

There will be several ways to avoid this issue. You should place the fixed element into the DOM root tree. (https://jsfiddle.net/ko2in/0oc8xbzq/3/).

Or you should applied the container element as inline-block (https://jsfiddle.net/ko2in/0oc8xbzq/17/). I refer MDN specification:

The element generates a block element box that will be flowed with surrounding content as if it were a single inline box (behaving much like a replaced element would).

You can also use overflow property (https://jsfiddle.net/ko2in/0oc8xbzq/18/), but not a very good solution if you need some overflow elements like dropdown or popup.

@MrL1605
Copy link
Contributor Author

MrL1605 commented Oct 2, 2020

That was easier than expected.

Thanks a lot.

@MrL1605 MrL1605 closed this as completed Oct 2, 2020
@lubber-de lubber-de removed state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug labels Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/css Anything involving CSS
Projects
None yet
Development

No branches or pull requests

3 participants