Skip to content

Commit

Permalink
fix onTextChange was often not called when there is a text change
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-chung committed Jan 18, 2025
1 parent 7f702a7 commit ef467bc
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -440,7 +441,12 @@ fun CoreBigTextField(

val textRef = weakRefOf(text)
val transformedTextRef = weakRefOf(transformedText)
val onTextChangeRef = weakRefOf(onTextChange)
// val onTextChangeRef = weakRefOf(onTextChange)
// val onTextChangeUpdated = rememberUpdatedState(onTextChange)
// val onTextChangeRef = remember(weakRefOf(onTextChangeUpdated)) {
// LazyDelegate { onTextChangeUpdated }
// }
val onTextChangeRef by rememberUpdatedState(weakRefOf(onTextChange))

// log.v { "text = |${text.buildString()}|" }
// log.v { "transformedText = |${transformedText.buildString()}|" }
Expand Down

0 comments on commit ef467bc

Please sign in to comment.