Skip to content

Commit

Permalink
Enable secondary action button in input phone number if input has rea…
Browse files Browse the repository at this point in the history
…ched minimum length
  • Loading branch information
msasikanth committed Sep 26, 2023
1 parent 3b75214 commit ec565a7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fun InputPhoneNumber(
imeAction: ImeAction = ImeAction.Next,
notation: RegExValidations = RegExValidations.PHONE_NUMBER,
) {
val hasPhoneNumber = inputText?.length == maxLength
val hasMinimumPhoneNumberInput = inputText.orEmpty().length > 2
val supportingText = if (state == InputShellState.ERROR) {
listOf(
SupportingTextData(
Expand Down Expand Up @@ -78,7 +78,7 @@ fun InputPhoneNumber(
actionButton = {
SquareIconButton(
modifier = Modifier.testTag("CALL_PHONE_NUMBER_BUTTON"),
enabled = hasPhoneNumber,
enabled = hasMinimumPhoneNumberInput,
icon = {
Icon(
painter = provideDHIS2Icon("dhis2_phone_positive"),
Expand Down

0 comments on commit ec565a7

Please sign in to comment.