Modal opening moves body up
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
Opening a modal does not moves body up.
What is the current behavior?
A negative top
is applied to the body, causing elements to go up. This comes back to normal when closing the modal
What are the steps to reproduce?
- Create an element with
position: fixed
- Scroll down your page so that you are not at the top
- Open the modal
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
- Angular core : 4.3.1
- Angular material : 2.0.0-beta.8
- TypeScript : 2.3.4
Tested on chrome 61 Win / Mac / Linux
Is there anything else we should know?
❤️
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Bootstrap modal: background jumps to top on toggle
When the modal opens a modal-open class is set to the <body> tag. This class sets overflow: hidden; to the body. Add this...
Read more >Modal - Bootstrap
The modal plugin toggles your hidden content on demand, via data attributes or JavaScript. It also adds . modal-open to the <body> to...
Read more >How to prevent Body from scrolling when a modal is opened ...
Given an HTML document with a modal, the task is to prevent the body element from scrolling whenever the modal is in an...
Read more >Bootstrap Modal Position - Visual LightBox
In the event that the height of a modal switch though it is open up, you can command $(' #myModal'). data(' bs.modal'). handleUpdate()...
Read more >Prevent Page Scrolling When a Modal is Open | CSS-Tricks
You open a modal, scroll through it, close it, and wind up somewhere ... the body still scrolls when a modal is open...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+1
I fixed it like this
I faced same problem. Following solution work for me,
Put it into your global css or in dialog components loacl css (you have to enable view encapsulation in case of local)