Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-toast makes scroll bar appear during animation when positionned bottom #2936

Closed
NicolasVargas opened this issue May 21, 2015 · 38 comments
Closed
Assignees
Milestone

Comments

@NicolasVargas
Copy link

Hi guys,

Thanks for your constant enhancement of angular material design.

As you can see on CodePen where i reused the doc demo, the scroll bar appears during the appear/disappear animation of a md-toast component positioned at bottom.
It is certainly caused by the fact that the md-toast component is first created at position documents' height + its own height and then it goes up a position documents' height.
On the other hand, this event doesn't appear when the toast is positioned top even if it's animation shows him appearing from a higher position.

Thank you,

Izcalli

@TalPasi
Copy link

TalPasi commented May 21, 2015

+1

1 similar comment
@Lenninlasd
Copy link

+1

@ThomasBurleson ThomasBurleson modified the milestone: Backlog May 28, 2015
@mpelts
Copy link

mpelts commented Jun 7, 2015

+1

6 similar comments
@webley
Copy link

webley commented Jun 8, 2015

+1

@gpopovic
Copy link

+1

@ricardobfa
Copy link

+1

@visurel
Copy link

visurel commented Jun 19, 2015

+1

@theblang
Copy link

+1

@vigneshdv
Copy link

+1

@karthikcsridhar
Copy link

+1

3 similar comments
@matpag
Copy link

matpag commented Aug 7, 2015

+1

@giulioprovasi
Copy link

+1

@thomasbertet
Copy link

+1

@gpopovic
Copy link

to get rid of scrollbar, just put overflow:hidden to body.

@matpag
Copy link

matpag commented Aug 28, 2015

In my case i've solved attaching the controller which control the toast to the body element.

@YashdalfTheGray
Copy link

+1

@ThomasBurleson ThomasBurleson added resolution: won't fix There are no resources to fix this issue, the priority is too low, or it doesn't align w/ MD spec. resolution: can't reproduce The team is unable to reproduce this issue with the information provided and removed resolution: won't fix There are no resources to fix this issue, the priority is too low, or it doesn't align w/ MD spec. labels Sep 4, 2015
@ThomasBurleson
Copy link
Contributor

Works fine on online Docs.

@rscottfree
Copy link

It works in the demo page because the demo's container has overflow: hidden which is added as part of the .demo-content class. Look at the codepen posted in the first comment here; it's broken there because its container does not have overflow: hidden.

If this isn't going to be fixed, then it should be documented that to use mdToast you have to set its container to have overflow: hidden.

@HartgerV
Copy link

HartgerV commented Sep 7, 2015

+1

@ThomasBurleson
Copy link
Contributor

@rscottfree - Excellent point. This needs either a doc change or component improvement.

I think a component improvement of adjusting the positioning or improving the SCSS.

@topherfangio
Copy link
Contributor

Bumping priority; will try to get it done in RC4.

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc4, 1.0-rc5 Nov 16, 2015
@topherfangio topherfangio modified the milestones: 1.0-rc6, 1.0-rc5 Nov 23, 2015
topherfangio added a commit that referenced this issue Dec 1, 2015
During animation, certain browsers would show scroll bars if the
toast was positioned at the bottom of the parent container.

Fix by adding a class to the parent which sets the overflow to
hidden only during the animations.

Also, update documentation with notes about positioning and
recommendations.

Fixes #2936.
topherfangio added a commit that referenced this issue Dec 2, 2015
During animation, certain browsers would show scroll bars if the
toast was positioned at the bottom of the parent container.

Fix by wrapping the animated portions in a div with hidden
overflow.

Also, update documentation with notes about positioning and
recommendations.

BREAKING CHANGE

md-toast now applies the enter/leave animations to a wrapper
div with a class `md-toast-wrapper`. If you have customized
the animations or other styles of your toast, you will need
to update your CSS to account for the new wrapper.

Fixes #2936.
topherfangio added a commit that referenced this issue Dec 2, 2015
During animation, certain browsers would show scroll bars if the
toast was positioned at the bottom of the parent container.

Fix by wrapping the animated portions in a div with hidden
overflow.

Also, update documentation with notes about positioning and
recommendations.

BREAKING CHANGE

md-toast now applies the enter/leave animations to a wrapper
div with a class `md-toast-wrapper`. If you have customized
the animations or other styles of your toast, you will need
to update your CSS to account for the new wrapper.

Fixes #2936.
topherfangio added a commit that referenced this issue Dec 2, 2015
During animation, certain browsers would show scroll bars if the
toast was positioned at the bottom of the parent container.

Fix by wrapping the animated portions in a div with hidden
overflow.

Also, update documentation with notes about positioning and
recommendations.

BREAKING CHANGE

md-toast now applies the enter/leave animations to an inner
div with a class `md-toast-content`. If you have customized
the animations or other styles of your toast, you will need
to update your CSS to account for the new wrapper.

Fixes #2936.
topherfangio added a commit that referenced this issue Dec 7, 2015
During animation, certain browsers would show scroll bars if the
toast was positioned at the bottom of the parent container.

Fix by wrapping the animated portions in a div with hidden
overflow.

Also, update documentation with notes about positioning and
recommendations.

BREAKING CHANGE

md-toast now applies the enter/leave animations to an inner
div with a class `md-toast-content`. If you have customized
the animations or other styles of your toast, you will need
to update your CSS to account for the new wrapper.

Fixes #2936.

Closes #6029
@TheJesper
Copy link

In my case the scroll-bar is hidden shortly during the animation. This creates a "flickering" user experience every time the toast is displayed, especially when many toasts are "queued up" and the scroll-bar shows and hides multiple times.

The CSS causing this should definitely be eliminated from the angular/material code.

From angular-material.css:
md-toast-animating{ overflow:hidden!important }

So, depending on what you want to achieve you could always override this:
body.md-toast-animating { overflow: auto !important; }

Hope this helps someone! /Jesper Wilfing

@chris-carrington
Copy link

@TheJesper Thank you for existing!

@DmitryEfimenko
Copy link

in latest version they prefixed this class with an underscore. So:

body._md-toast-animating { overflow: auto !important; }

@bobwah
Copy link

bobwah commented Aug 15, 2016

sorry for my lack of understanding, why is:

md-toast-animating{ overflow:hidden!important }

needed in the first place?

@topherfangio
Copy link
Contributor

@bobwah That code was added to fix this bug (#2936) of the scrollbars appearing during animations. We have a better fix in mind and I had a working prototype at one point. I will track that down and see what it wasn't merged.

@bobwah
Copy link

bobwah commented Aug 17, 2016

sounds good! thanks

@RyanHayden
Copy link

RyanHayden commented Sep 5, 2016

I was having the same issue, fixed by wrapping my root component in md-content with flex set to 100. This also fixed the issue of the toast appearing mid screen when I scrolled. If you look at the html the body was not growing appropriately with the component content, unless this was added.

<md-content flex="100"> <menu></menu> <div style="padding: 5px;"> <page></page> </div> </md-content>

@eranshapira
Copy link

i have to say that the fix of overflow: hidden !important; is probably the worst possible fix to that error. breaks pages.

@jjhesk
Copy link

jjhesk commented Dec 7, 2016

+∞

@dcarrask
Copy link

dcarrask commented Jan 3, 2017

Thanks @RyanHayden!!
After few day investing some time without getting any solution FINALLY I got it thank to your tip!
Cheers, mate!

@Anujndls
Copy link

Anujndls commented Jun 6, 2017

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests