-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdBottomSheet not positioned on the bottom the right way. #1211
Comments
Can you please provide plunker or codepen so we can review the problem live? |
Here's a basic Plunker that you can fork, if that helps: http://plnkr.co/edit/G0CCmRfi9CHxCPkwkiND (don't forget to change the version of angular-material in the included files). |
Here is a plunker demonstrating this: http://embed.plnkr.co/PulmZ2gQSFN7THSLZnzS/preview Looks like this is due to the css defaults. Padding on the bottom of the sheet is set to 80px, yet the box is positioned absolutely at the bottom. This results in 80px overhanging the bottom of the page. From bottomSheet.scss: $bottom-sheet-hidden-bottom-padding: 80px !default;
...
md-bottom-sheet {
...
transform: translate3d(0, $bottom-sheet-hidden-bottom-padding, 0);
...
}
...
&.ng-enter-active {
...
transform: translate3d(0, $bottom-sheet-hidden-bottom-padding, 0) !important;
} Should $bottom-sheet-hidden-bottom-padding default to 0 instead of 80? |
The additional padding is to allow the bottom sheet to be dragged up further than the length of the sheet. This gives it a satisfying wiggle on mobile when you're pulling the sheet up past it's height. I was unable to recreate the issue using master... Please see if you can recreate here and open a new issue if necessary. Thanks! |
This still happens on non-mobile devices. You are able to scroll the page with the mouse scroll wheel. Touch controls, as you mentioned, have had this behavior changed / fixed. Plunk with scroll bar using updated sources here: http://plnkr.co/edit/JzUxerntOuzj9d7aF9gS?p=preview @tforbus setting overflow:hidden on the body will get rid of scroll bar and the ability to scroll through the extra padding with the scroll wheel. |
@rschmukler page up/down and arrow keys will also demonstrate the same behavior as the scroll wheel. Kind of related previous message in this sequence: it seems like the reason this doesn't happen in the docs is because the div (.demo-content) that contains the bottom sheet has overflow:hidden set. |
What is the status of this ? I use a bottomsheet with RC3. The display is perfect under my iphone. But on a desktop browser it shows a vertical scrollbar because of the bottom padding... |
md-bottom-sheet { Should save the day, only tested on safari iPhone, chrome iPhone and chrome desktop but it should also work for the rest. The value 80px need adjustment |
I've created a bottomSheet, but its position is not correct.
Regardless of the content in the sheet, it goes lower than the bottom of the page, resulting in a scrollbar appearing.
This is the CSS for the sheet.
Here is the markup for the sheet:
I'm using 0.6.1
My workaround so far is just adding a lot of padding to the md-bottom-sheet to get the contents to appear.
The text was updated successfully, but these errors were encountered: