Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal-Component backdrop fade effect glitches #687

Closed
keliel opened this issue Jul 4, 2016 · 17 comments
Closed

Modal-Component backdrop fade effect glitches #687

keliel opened this issue Jul 4, 2016 · 17 comments

Comments

@keliel
Copy link

keliel commented Jul 4, 2016

When activating the modal backdrop, for a fraction of a second the background gets dark without fade effect. Then it gets back to transparent and only after that a fade effect is triggered.
Tested in Chrome, Firefox and Edge. The Problem does not occur with Bootstrap only modal.

You can compare this on both demo pages:

@PEsteves8
Copy link

I asked about that too in the gitter channel, but got no answers. It seems to me that instead of the background's element opacity starting at 0 and move gradually to somewhere near 50%, it starts at 100% and then moves down, or something.

@Dinistro
Copy link
Contributor

Dinistro commented Jul 5, 2016

I can confirm this, but I can't see where this is coming from. Perhaps @valorkin can help.

@valorkin
Copy link
Member

to be honest I was fighting a bit with it,
what I can say and do to fix it:

  • when classes and properties are added via binding - it laggs
  • when via Renderer - works fine, but code looks ugly

I am waiting for ng2-animate and try it

@keliel
Copy link
Author

keliel commented Jul 15, 2016

Can @valorkin post the said ugly code, so we can patch our page until you are able to actually close this issue.

@valorkin
Copy link
Member

OK, can I do it nearest Monday?
I am planning to release new datepicker with pop up version

@valorkin valorkin reopened this Jul 15, 2016
@BenevidesLecontes
Copy link

@valorkin @KIMBUM I've fixed this with css.

@MaximilianWiedemann
Copy link

@BenevidesLecontes Nice to hear. Could you please share the solution with all of us?

@BenevidesLecontes
Copy link

@MaximilianWiedemann here's my css with animation
.modal-backdrop{
transition-duration: 0.4s;
background: rgba(55, 58, 71, 0.9);
transition: opacity 0.3s;
}
.modal-backdrop.in{
opacity: 1;
}
.modal .modal-content{
-webkit-animation-duration: 0.4s;
animation-duration: 0.4s;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
border-radius: 0;
}
.modal.fade.in .modal-content{
-webkit-animation-name: anim-open;
animation-name: anim-open;
-webkit-animation-timing-function: cubic-bezier(0.6,0,0.4,1);
animation-timing-function: cubic-bezier(0.6,0,0.4,1);
}

.modal.fade .modal-content{
-webkit-animation-name: anim-close;
animation-name: anim-close;
}
@-webkit-keyframes anim-open {
0% { opacity: 0; -webkit-transform: scale3d(0, 0, 1); }
100% { opacity: 1; -webkit-transform: scale3d(1, 1, 1); }
}

@Keyframes anim-open {
0% { opacity: 0; -webkit-transform: scale3d(0, 0, 1); transform: scale3d(0, 0, 1); }
100% { opacity: 1; -webkit-transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1); }
}

@-webkit-keyframes anim-close {
0% { opacity: 1; }
100% { opacity: 0; -webkit-transform: scale3d(0.5, 0.5, 1); }
}

@Keyframes anim-close {
0% { opacity: 1; }
100% { opacity: 0; -webkit-transform: scale3d(0.5, 0.5, 1); transform: scale3d(0.5, 0.5, 1); }
}

@MaximilianWiedemann
Copy link

@BenevidesLecontes This only fixes the issue partially because now you're missing the fade in animation. The backdrop now appears instantly. It's way better than before, however it's not fixed completely.

@BenevidesLecontes
Copy link

@MaximilianWiedemann try to change the animations duration.

@LukeStonehm
Copy link

LukeStonehm commented Jul 18, 2016

@BenevidesLecontes That CSS fix is very close, but as @MaximilianWiedemann points out, there is no fade in animation at all, alerting the animation durations don't seem to have an effect. Will try work out CSS that is a complete workaround.

@valorkin
Copy link
Member

Guys ugly fix deployed to http://valor-software.com/ng2-bootstrap/#/modals
please test, if it is fine for now
I will publish this version

@LukeStonehm
Copy link

@valorkin as ugly fixes go, that's a good one. Thanks very much.

@MaximilianWiedemann
Copy link

@valorkin Works for me. 👍

@valorkin
Copy link
Member

awesome, publishing

@valorkin
Copy link
Member

published

@valorkin
Copy link
Member

use https://www.hamsterpad.com/chat/ng2 to get in touch

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

No branches or pull requests

7 participants