@@ -52,7 +52,13 @@ export const machine = createMachine({
52
52
53
53
watch ( { context, prop, track, action } ) {
54
54
track ( [ ( ) => context . get ( "value" ) ] , ( ) => {
55
- action ( [ "allowIndicatorTransition" , "syncIndicatorRect" , "syncTabIndex" , "navigateIfNeeded" ] )
55
+ action ( [
56
+ "allowIndicatorTransition" ,
57
+ "syncIndicatorDisabled" ,
58
+ "syncIndicatorRect" ,
59
+ "syncTabIndex" ,
60
+ "navigateIfNeeded" ,
61
+ ] )
56
62
} )
57
63
track ( [ ( ) => prop ( "dir" ) , ( ) => prop ( "orientation" ) ] , ( ) => {
58
64
action ( [ "syncIndicatorRect" ] )
@@ -74,7 +80,7 @@ export const machine = createMachine({
74
80
} ,
75
81
} ,
76
82
77
- entry : [ "syncIndicatorRect" , "syncTabIndex" , "syncSsr" ] ,
83
+ entry : [ "syncIndicatorDisabled" , " syncIndicatorRect", "syncTabIndex" , "syncSsr" ] ,
78
84
79
85
exit : [ "cleanupObserver" ] ,
80
86
@@ -261,7 +267,6 @@ export const machine = createMachine({
261
267
if ( ! triggerEl ) return
262
268
263
269
context . set ( "indicatorRect" , dom . getRectById ( scope , value ) )
264
- context . set ( "indicatorDisabled" , dom . getIsTriggerDisabled ( scope , value ) )
265
270
266
271
nextTick ( ( ) => {
267
272
context . set ( "indicatorTransition" , false )
@@ -270,6 +275,12 @@ export const machine = createMachine({
270
275
syncSsr ( { context } ) {
271
276
context . set ( "ssr" , false )
272
277
} ,
278
+ syncIndicatorDisabled ( { context, scope } ) {
279
+ const value = context . get ( "value" )
280
+ if ( value ) {
281
+ context . set ( "indicatorDisabled" , dom . getIsTriggerDisabled ( scope , value ) )
282
+ }
283
+ } ,
273
284
syncIndicatorRect ( { context, refs, scope } ) {
274
285
const cleanup = refs . get ( "indicatorCleanup" )
275
286
if ( cleanup ) cleanup ( )
@@ -291,7 +302,6 @@ export const machine = createMachine({
291
302
onEntry ( { rects } ) {
292
303
const [ rect ] = rects
293
304
context . set ( "indicatorRect" , dom . resolveRect ( rect ) )
294
- context . set ( "indicatorDisabled" , dom . getIsTriggerDisabled ( scope , value ) )
295
305
} ,
296
306
} )
297
307
0 commit comments