File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed
packages/machines/radio-group/src Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @zag-js/radio-group " : patch
3
+ ---
4
+
5
+ Fix segmented control not transitioning after first render
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ export function machine(userContext: UserDefinedContext) {
13
13
id : "radio" ,
14
14
initial : "idle" ,
15
15
context : {
16
- previousValue : null ,
17
16
value : null ,
18
17
activeId : null ,
19
18
focusedId : null ,
@@ -96,11 +95,8 @@ export function machine(userContext: UserDefinedContext) {
96
95
input . checked = input . value === ctx . value
97
96
} )
98
97
} ,
99
- setPreviousValue ( ctx ) {
100
- ctx . previousValue = ctx . value
101
- } ,
102
98
setIndicatorTransition ( ctx ) {
103
- ctx . canIndicatorTransition = isString ( ctx . previousValue ) && isString ( ctx . value )
99
+ ctx . canIndicatorTransition = isString ( ctx . value )
104
100
} ,
105
101
cleanupObserver ( ctx ) {
106
102
ctx . indicatorCleanup ?.( )
Original file line number Diff line number Diff line change @@ -81,11 +81,6 @@ type PrivateContext = Context<{
81
81
* Function to clean up the observer for the active tab's rect
82
82
*/
83
83
indicatorCleanup ?: VoidFunction | null
84
- /**
85
- * @internal
86
- * The previous value of the radio group
87
- */
88
- previousValue : string | null
89
84
} >
90
85
91
86
export type UserDefinedContext = RequiredBy < PublicContext , "id" >
You can’t perform that action at this time.
0 commit comments