Skip to content

Commit c8f455a

Browse files
committed
fix: Switch crash with off state.
1 parent 5a403dc commit c8f455a

File tree

1 file changed

+4
-6
lines changed
  • miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic

1 file changed

+4
-6
lines changed

miuix/src/commonMain/kotlin/top/yukonga/miuix/kmp/basic/Switch.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ fun Switch(
8080
var hasVibrated by remember { mutableStateOf(false) }
8181
var hasVibratedOnce by remember { mutableStateOf(false) }
8282

83-
val springSpec = remember {
84-
spring<Dp>(
85-
dampingRatio = Spring.DampingRatioLowBouncy,
86-
stiffness = Spring.StiffnessMedium
87-
)
88-
}
83+
val springSpec = spring<Dp>(
84+
dampingRatio = Spring.DampingRatioLowBouncy,
85+
stiffness = Spring.StiffnessMedium
86+
)
8987

9088
var dragOffset by remember { mutableStateOf(0f) }
9189
val thumbOffset by animateDpAsState(

0 commit comments

Comments
 (0)