diff --git a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt index ea234f1b4d..9800af5b88 100644 --- a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt +++ b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/CreatePollView.kt @@ -259,7 +259,7 @@ private fun MaxSelectionsStepper( ) { Icon( imageVector = CompoundIcons.Minus(), - contentDescription = null, + contentDescription = stringResource(id = CommonStrings.a11y_create_poll_votes_allowed_decrease), modifier = Modifier .clickable(enabled = current > 1) { onDecrement() } .size(32.dp) @@ -277,7 +277,7 @@ private fun MaxSelectionsStepper( ) Icon( imageVector = CompoundIcons.Plus(), - contentDescription = null, + contentDescription = stringResource(id = CommonStrings.a11y_create_poll_votes_allowed_increase), modifier = Modifier .clickable(enabled = current < max) { onIncrement() } .size(32.dp) diff --git a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/PollFormState.kt b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/PollFormState.kt index eae39a670d..d7198b8c3d 100644 --- a/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/PollFormState.kt +++ b/features/poll/impl/src/main/kotlin/io/element/android/features/poll/impl/create/PollFormState.kt @@ -46,8 +46,6 @@ data class PollFormState( * Create a copy of the [PollFormState] with a new blank answer added. * * If the maximum number of answers has already been reached an answer is not added. - * - * Also clamps [maxSelections] to the new answer count to keep state consistent. */ fun withNewAnswer(): PollFormState { if (!canAddAnswer) { @@ -55,8 +53,7 @@ data class PollFormState( } val newAnswers = (answers + "").toImmutableList() - val clampedMaxSelections = maxSelections.coerceIn(1, newAnswers.size) - return copy(answers = newAnswers, maxSelections = clampedMaxSelections) + return copy(answers = newAnswers) } /** @@ -103,11 +100,6 @@ data class PollFormState( */ val canDeleteAnswer get() = answers.size > MIN_ANSWERS - /** - * The effective max selections, clamped to the number of answers. - */ - val effectiveMaxSelections get() = maxSelections.coerceIn(1, answers.size) - /** * Whether the form is currently valid. */