mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
feedback_widget: Don't use non-optimal animation properties.
Animating `box-shadow` and `top` is slow since the browser drops frames when animating them. We can fix it by using `will-change` property but it is just better to not animate them and instead use transform.
This commit is contained in:
@@ -64,7 +64,16 @@ const animate = {
|
||||
}
|
||||
|
||||
if (meta.$container) {
|
||||
meta.$container.fadeOut(500).removeClass("show");
|
||||
meta.$container.addClass("slide-out-feedback-container");
|
||||
// Delay setting `display: none` enough that the hide animation starts.
|
||||
setTimeout(
|
||||
() =>
|
||||
meta.$container?.removeClass([
|
||||
"show-feedback-container",
|
||||
"slide-out-feedback-container",
|
||||
]),
|
||||
50,
|
||||
);
|
||||
meta.opened = false;
|
||||
meta.alert_hover_state = false;
|
||||
}
|
||||
@@ -75,7 +84,7 @@ const animate = {
|
||||
}
|
||||
|
||||
if (meta.$container) {
|
||||
meta.$container.fadeIn(500).addClass("show");
|
||||
meta.$container.addClass("show-feedback-container");
|
||||
meta.opened = true;
|
||||
setTimeout(() => animate.maybe_close(), 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user