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

md-fab-speed-dial showing actions when isOpen is false. #6111

Closed
piyushchauhan2011 opened this issue Dec 7, 2015 · 22 comments
Closed

md-fab-speed-dial showing actions when isOpen is false. #6111

piyushchauhan2011 opened this issue Dec 7, 2015 · 22 comments
Labels
P1: urgent Urgent issues that should be addressed in the next minor or patch release.

Comments

@piyushchauhan2011
Copy link

EDIT FROM CORE TEAM: This issue has been locked, please refer to #6788 and #6789 as we split it into two issues.

The current screenshot is from the latest material angular website.
I can see in the code that this.isOpen=false but the actions are visible and when we click on button, only after that it triggers the show and hide functionality.
However, in the bottom example it seems to work fine, don't know why ?

Can anyone elaborate on this how to hide on initial load the actions behind the big icon button.

screen shot 2015-12-07 at 2 17 45 pm

@piyushchauhan2011
Copy link
Author

Found that md-fling animation is buggy and makes the fab-speed-dial to remain open initially. Works perfectly in md-scale animation.

@jelbourn jelbourn added this to the 1.0-rc8 milestone Dec 9, 2015
@topherfangio topherfangio added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Dec 9, 2015
topherfangio added a commit that referenced this issue Dec 9, 2015
Due to an animation issue, the FAB Speed Dial started in an open
state when using the `md-fling` animation.

Fix by delaying the initial animation until after the component
was fully rendered so that the animation's calculations were correct
and adding some CSS to ensure the first animation fired instantly.

Fixes #6111.
topherfangio added a commit that referenced this issue Dec 10, 2015
Due to an animation issue, the FAB Speed Dial started in an open
state when using the `md-fling` animation.

Fix by delaying the initial animation until after the component
was fully rendered so that the animation's calculations were correct
and adding some CSS to ensure the first animation fired instantly.

Fixes #6111.
topherfangio added a commit that referenced this issue Dec 10, 2015
Due to an animation issue, the FAB Speed Dial started in an open
state when using the `md-fling` animation.

Fix by delaying the initial animation until after the component
was fully rendered so that the animation's calculations were correct
and adding some CSS to ensure the first animation fired instantly.

Fixes #6111.
@epelc
Copy link
Contributor

epelc commented Dec 16, 2015

@topherfangio This is still broken in 1.0.0(and master) if you run it locally(might have to be outside of the docs demo too).

Also can't really workaround it by using md-scale as #6344 was also introduced when you run it locally.

@trevorade
Copy link

Finally figured it out. fabSpeedDial will start out visible if not enclosed with an ng-cloak (either on the md-fab-speed-dial itself or an enclosing ancestor element.)

To repro:

At this point, the speed dial will start open.

@rudzikdawid
Copy link
Contributor

md-flying in final version 1.0.0 is still broken

@topherfangio
Copy link
Contributor

@trevorade Thanks for the update; you are indeed correct about ng-cloak. This does make for a decent workaround though, just add the ng-cloak to the speed dial itself and it should work.

The base issue here is that with just HTML/CSS, the speed dial uses flex positioning and is thus open "by default". We use JS animations to close it, but those don't always seem to fire as expected. The real solution would be to rewrite it using absolute positioning where the elements start out overlapping/hidden and use the JS animations to reposition it to be open, but I think this may be too big of a change for a 1.0.1, so I'll try to find a different workaround.

In the meantime, can you test adding the ng-cloak and make sure it works for everyone's cases? If so, I'll add a note to the docs until we get this more properly fixed.

@johnsheldon
Copy link

Also having this issue, ng-cloak fix worked for one of our speed dials. However, we have another speed dial which is hidden initially using ng-hide, then shown, and when used in conjunction with ng-cloak it causes the action items to be always expanded and invisible, but clickable.
ng-cloak-with-ng-hide-issue

@epelc
Copy link
Contributor

epelc commented Dec 16, 2015

@topherfangio I just tested Adding ng-cloak to md-speeddial in 1.0.0

With md-fling it works perfectly as far as I can tell. Both refreshing while on and navigating to a page with the speeddial works as expected with no close animations playing or it starting out open.

With md-scale the actions start out very tiny as seen in this picture but they instantly animate out and shrink to nothing. It's very noticable but I'll just use ng-cloak with md-fling for now.
image

@topherfangio
Copy link
Contributor

@epelc Can you test the CSS hack for the md-scale animation that I mentioned in #6344? Should fix the issue for you so you can continue to use that animation.

@epelc
Copy link
Contributor

epelc commented Dec 16, 2015

@topherfangio just did. It fixed it!

@topherfangio
Copy link
Contributor

@johnsheldon Can you provide a Codepen so that I can play around and try to find a quick workaround and then a more robust fix?

@johnsheldon
Copy link

@topherfangio
Copy link
Contributor

Thanks for the demo; I definitely see the issue.

@Frank3K
Copy link
Contributor

Frank3K commented Dec 27, 2015

+1

@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc8, 1.1.0 Jan 5, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc8, 1.1.0, Backlog Jan 5, 2016
@topherfangio topherfangio modified the milestones: 1.1.0, Backlog Jan 6, 2016
@tonyeung
Copy link

tonyeung commented Jan 6, 2016

+1 spent an entire day trying to debug this. Should have just checked. T.T

@objecteer
Copy link

I think the problem was from jqLite. So, I added JQuery to my main page and the problem was solved.

@tonyeung
Copy link

tonyeung commented Jan 7, 2016

@objecteer i have the full version of jquery, also. Without the ng-cloak its still broke.

@ThomasBurleson ThomasBurleson added P1: urgent Urgent issues that should be addressed in the next minor or patch release. and removed priority: critical labels Jan 13, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.1.0, Backlog Jan 13, 2016
topherfangio added a commit to profoundry-us/material that referenced this issue Jan 20, 2016
There is currently a need to use `ng-cloak` on the parent container
of the speed dial.

Add a "Troubleshooting" section to the documentation which notes
this issue.

Fixes angular#6111.
@tonyeung
Copy link

@ThomasBurleson out of curiosity, how do you guys keep track of items where there are plans to fix stuff if you close the issue?

@topherfangio
Copy link
Contributor

@tonyeung Apologies, it looks like a comment I made yesterday never got saved.

I have created two separate issues to track this better: #6788 for the generic issue of requiring ng-cloak and #6789 for the ng-cloak/ng-hide bug. We are planning to track them there.

@tonyeung
Copy link

@topherfangio no worries. I thought that maybe you guys had some other workflow other than github issues. If you did, then maybe there's something I can learn from it.

@felipekm
Copy link

+1 on that guys!

@matewilk
Copy link

matewilk commented Feb 3, 2016

yep, +1 too!

@tonyeung
Copy link

tonyeung commented Feb 3, 2016

probably should get this locked and point people to #6788 and #6789 if they want to keep track of progress

@angular angular locked and limited conversation to collaborators Feb 3, 2016
@ThomasBurleson ThomasBurleson removed the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Apr 25, 2016
@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: urgent Urgent issues that should be addressed in the next minor or patch release.
Projects
None yet
Development

No branches or pull requests