Skip to content

Commit ee4e481

Browse files
authored
fix #113 Invert animation so that when not visible to start, there is no animation off screen (#114)
1 parent be84965 commit ee4e481

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/devToolUI.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ export const DevToolUI = ({ control, placement = 'top-right' }: Props) => {
2626
return (
2727
<>
2828
<Animate
29-
play={!state.visible}
29+
play={state.visible}
3030
duration={0.2}
3131
start={{
3232
...position,
3333
position: 'fixed',
34-
transform: 'translateX(0)',
34+
transform: placement.includes('right')
35+
? 'translateX(280px)'
36+
: 'translateX(-280px)',
3537
zIndex: 99999,
3638
}}
3739
end={{
3840
...position,
3941
position: 'fixed',
40-
transform: placement.includes('right')
41-
? 'translateX(280px)'
42-
: 'translateX(-280px)',
42+
transform: 'translateX(0)',
4343
zIndex: 99999,
4444
}}
4545
>

0 commit comments

Comments
 (0)