Skip to content

Commit

Permalink
[ANDROAPP-5725] Add overflow and max line parameter to input dropdown (
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy authored Nov 9, 2023
1 parent 55885f5 commit e4b0128
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import org.hisp.dhis.common.screens.previews.lorem
import org.hisp.dhis.mobile.ui.designsystem.component.ColumnComponentContainer
import org.hisp.dhis.mobile.ui.designsystem.component.InputDropDown
import org.hisp.dhis.mobile.ui.designsystem.component.InputShellState
Expand All @@ -23,7 +24,7 @@ import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor
@Composable
fun InputDropDownScreen() {
ColumnComponentContainer {
val options = listOf("Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7")
val options = listOf(lorem, "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7")
var expanded by rememberSaveable { mutableStateOf(false) }

Title("Input Dropdown", textColor = TextColor.OnSurfaceVariant)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.style.TextOverflow
import org.hisp.dhis.mobile.ui.designsystem.theme.TextColor

/**
Expand Down Expand Up @@ -84,6 +85,8 @@ fun InputDropDown(
TextColor.OnDisabledSurface
},
),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
)
Box(
modifier = Modifier
Expand Down

0 comments on commit e4b0128

Please sign in to comment.