mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
fix(ui): ensure that group animations are enabled after mount
This commit is contained in:
committed by
Łukasz Mierzwa
parent
71839b0504
commit
17179f44b1
@@ -162,11 +162,15 @@ const AlertGroup = ({
|
||||
|
||||
const mountRef = useRef(null);
|
||||
|
||||
const [fadeDone, setFadeDone] = useState(false);
|
||||
|
||||
return useObserver(() => (
|
||||
<div
|
||||
ref={mountRef}
|
||||
className={`components-grid-alertgrid-alertgroup ${
|
||||
mountRef.current ? "components-animation-fade-appear-done" : ""
|
||||
mountRef.current && fadeDone
|
||||
? "components-animation-fade-appear-done"
|
||||
: ""
|
||||
}`}
|
||||
style={{
|
||||
width: groupWidth,
|
||||
@@ -180,6 +184,7 @@ const AlertGroup = ({
|
||||
in={context.animations.in}
|
||||
duration={context.animations.duration}
|
||||
wait={context.animations.duration}
|
||||
onReveal={() => setFadeDone(true)}
|
||||
>
|
||||
<div
|
||||
className={`card ${cardBackgroundClass}`}
|
||||
|
||||
@@ -111,6 +111,8 @@ describe("<AlertGroup />", () => {
|
||||
.hasClass("components-animation-fade-appear-done")
|
||||
).toBe(false);
|
||||
tree.setProps({});
|
||||
act(() => tree.find("RevealBase").at(0).props().onReveal());
|
||||
tree.update();
|
||||
expect(
|
||||
tree
|
||||
.find("div.components-grid-alertgrid-alertgroup")
|
||||
|
||||
Reference in New Issue
Block a user