everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
906 stars 44 forks source link

work with react-transition-group , sometimes will flashing before the animation starts #79

Closed dmwin72015 closed 2 years ago

dmwin72015 commented 3 years ago

Describe the bug work with react-transition-group, if only simple fade-in or fade-out it will be ok, but use transform, will flashing before the animation starts。 css like

.zoom-top-right-enter {
  opacity: 0;
  transform: scale(0.85);
}

.zoom-top-right-enter-active {
  opacity: 1;
  transform: scale(1);
}
.zoom-top-right-exit {
  opacity: 1;
  transform: scale(1);
}

.zoom-top-right-exit-active {
  opacity: 0;
  transform: scale(0.85);
}

.zoom-top-right-enter-active,
.zoom-top-right-exit-active {
  transform-origin: right top;
  transition: transform 200ms, opacity 200ms;
}

I found when animation start, value of layerProps.style.top is 0, it shuld be the right value before aniamtion start

To Reproduce Steps to reproduce the behavior:

Expected behavior do not flashing

Screenshots

Browser / OS (please complete the following information):

Additional context