Skip to content

Commit 867c3c6

Browse files
committed
Minor fixes
1 parent a89d9e2 commit 867c3c6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

core/src/main/java/com/orange/ouds/core/component/OudsPinCodeInput.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private fun OudsPinCodeInputTooltipBox(textFieldState: TextFieldState, length: O
224224
}
225225

226226
@Composable
227-
fun OudsPinCodeInputDecorator(
227+
private fun OudsPinCodeInputDecorator(
228228
textFieldState: TextFieldState,
229229
length: OudsPinCodeInputLength,
230230
outlined: Boolean,
@@ -250,9 +250,9 @@ fun OudsPinCodeInputDecorator(
250250
},
251251
horizontalArrangement = Arrangement.spacedBy(horizontalSpace)
252252
) {
253+
val isNonErrorPreview = LocalInspectionMode.current && error == null
254+
val focusedDigitIndex = (textFieldState.selection.end - 1).coerceIn(0, length.value - 1)
253255
repeat(length.value) { index ->
254-
val isNonErrorPreview = LocalInspectionMode.current && error == null
255-
val focusedDigitIndex = (textFieldState.selection.end - 1).coerceIn(0, length.value - 1)
256256
val digitInputState = when {
257257
(isNonErrorPreview || interactionState == InteractionState.Focused) && index == focusedDigitIndex -> OudsDigitInputState.Focused
258258
interactionState == InteractionState.Hovered -> OudsDigitInputState.Hovered

core/src/main/java/com/orange/ouds/core/component/OudsTextInput.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ internal fun OudsTextInputDecorator(
552552
with(OudsTheme.componentsTokens.textInput) {
553553
val borderRadius = if (LocalThemeSettings.current.roundedCornerTextInputs == true) borderRadiusRounded.value else borderRadiusDefault.value
554554
val shape = RoundedCornerShape(borderRadius)
555-
556-
// Voir si on peut utiliser rememberInteractionColor
555+
557556
val styleModifier = if ((outlined && state != OudsTextInputState.ReadOnly) || (!outlined && state == OudsTextInputState.ReadOnly)) {
558557
// outlined
559558
borderWidth(state)?.let { borderWidth ->

0 commit comments

Comments
 (0)