@@ -145,28 +145,33 @@ export default function MotionThumb(props: MotionThumbInterface) {
145
145
} , [ vertical , direction , nextStyle ] ) ;
146
146
147
147
// =========================== Motion ===========================
148
- const onAppearStart = ( ) =>
149
- vertical
150
- ? {
151
- transform : 'translateY(var(--thumb-start-top))' ,
152
- height : 'var(--thumb-start-height)' ,
153
- }
154
- : {
155
- transform : 'translateX(var(--thumb-start-left))' ,
156
- width : 'var(--thumb-start-width)' ,
157
- } ;
148
+ const onAppearStart = ( ) => {
149
+ if ( vertical ) {
150
+ return {
151
+ transform : 'translateY(var(--thumb-start-top))' ,
152
+ height : 'var(--thumb-start-height)' ,
153
+ } ;
154
+ }
158
155
159
- const onAppearActive = ( ) =>
160
- // Returns active transform and size styles for the thumb based on the layout orientation (vertical or horizontal).
161
- vertical
162
- ? {
163
- transform : 'translateY(var(--thumb-active-top))' ,
164
- height : 'var(--thumb-active-height)' ,
165
- }
166
- : {
167
- transform : 'translateX(var(--thumb-active-left))' ,
168
- width : 'var(--thumb-active-width)' ,
169
- } ;
156
+ return {
157
+ transform : 'translateX(var(--thumb-start-left))' ,
158
+ width : 'var(--thumb-start-width)' ,
159
+ } ;
160
+ } ;
161
+
162
+ const onAppearActive = ( ) => {
163
+ if ( vertical ) {
164
+ return {
165
+ transform : 'translateY(var(--thumb-active-top))' ,
166
+ height : 'var(--thumb-active-height)' ,
167
+ } ;
168
+ }
169
+
170
+ return {
171
+ transform : 'translateX(var(--thumb-active-left))' ,
172
+ width : 'var(--thumb-active-width)' ,
173
+ } ;
174
+ } ;
170
175
171
176
const onVisibleChanged = ( ) => {
172
177
setPrevStyle ( null ) ;
0 commit comments