Skip to content

Commit

Permalink
fix: Text Field IsError Not Changed Issue
Browse files Browse the repository at this point in the history
  • Loading branch information
8954sood committed Aug 28, 2024
1 parent 9d73221 commit 82fb374
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fun DodamTextField(
var isFocus by remember { mutableStateOf(false) }
val density = LocalDensity.current

val currentInputType by remember {
val currentInputType by remember(isFocus, value, isError) {
derivedStateOf {
focusStateAsInputType(
isFocused = isFocus,
Expand Down Expand Up @@ -297,7 +297,7 @@ fun DodamTextField(
var isFocus by remember { mutableStateOf(false) }
val density = LocalDensity.current

val currentInputType by remember {
val currentInputType by remember(isFocus, value, isError) {
derivedStateOf {
focusStateAsInputType(
isFocused = isFocus,
Expand Down Expand Up @@ -504,7 +504,7 @@ fun DodamFilledTextField(
var isFocus by remember { mutableStateOf(false) }
val density = LocalDensity.current

val currentInputType by remember {
val currentInputType by remember(isFocus, value, isError) {
derivedStateOf {
focusStateAsInputType(
isFocused = isFocus,
Expand Down Expand Up @@ -699,7 +699,7 @@ fun DodamFilledTextField(
var isFocus by remember { mutableStateOf(false) }
val density = LocalDensity.current

val currentInputType by remember {
val currentInputType by remember(isFocus, value, isError) {
derivedStateOf {
focusStateAsInputType(
isFocused = isFocus,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import com.b1nd.dodam.designsystem.component.DodamTextField
private fun DodamTextFieldPreview() {
val focusManager = LocalFocusManager.current
var value by remember { mutableStateOf("") }
var isError by remember { mutableStateOf(false) }
DodamTheme {
Column(
modifier = Modifier
Expand Down Expand Up @@ -118,10 +119,12 @@ private fun DodamTextFieldPreview() {
value = it
},
label = "Label text",
isError = true,
isError = isError,
enabled = true,
supportText = "Supporting text",
onClickRemoveRequest = {}
onClickRemoveRequest = {
isError = !isError
}
)
}
}
Expand Down

0 comments on commit 82fb374

Please sign in to comment.