GustavoCostaW / ngc-float-button

Google Material Design Float Button - Implementation for Angular v4+. Demo: http://bit.ly/2yIya2f
MIT License
58 stars 24 forks source link

Float Items Button BUG #10

Closed RicardoVaranda closed 6 years ago

RicardoVaranda commented 6 years ago

Pressing the Float item button does not reset the ngc-float-button active class and creates a visual bug:

gif

GustavoCostaW commented 6 years ago

@RicardoVaranda thx for the issue, can you provide a demo 'forking' the https://stackblitz.com/edit/ngc-float-button template?

leonardovff commented 6 years ago

@GustavoCostaW The bug occurred in here too.

GustavoCostaW commented 6 years ago

@RicardoVaranda @leonardovff can you provide me a demo link to reproduce this error?

RicardoVaranda commented 6 years ago

Project is private so sadly I am not able to give you a link to it, let me try and create a fresh repo to help you debug

GustavoCostaW commented 6 years ago

@RicardoVaranda can you provide me a link in stackblitz to simulate this behavior?

gm-r commented 6 years ago

@GustavoCostaW Here is a pretty simple case simulating this behavior, stackblitz.

Click on the first floating item and the red FAB button doesn't resize. It looks like the fab-menu active class doesn't get removed which causes the shrinking. Hope this helps!

Marshal27 commented 6 years ago

The issue here appears to be the following in the template markup. [class.active]=\"state.getValue().display\">

Modify it to the following in line 161 of ngc-float-button.component.js and the template markup will have a subscription to the Observable and toggle the class correctly. [class.active]=\"(state | async).display\">

GustavoCostaW commented 6 years ago

@RicardoVaranda @gabemazerogers @leonardovff

Hi guys, the problem is exactly what the @xxNoxiouSxx said, {{state.getValue().display}} was never notified when the state was changed causing the problem.

To fix that, {{(state | async).display}} is a great way that the angular provide us to subscribe the state and update the display property when the state change automatically.

Just update your ngc-float-button to 1.2.1 version and enjoy =]

Cheers to @xxNoxiouSxx.