Skip to content

Commit 400d805

Browse files
committed
reusing text input layout extension
1 parent 985e156 commit 400d805

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

vector/src/main/java/im/vector/app/core/extensions/TextInputLayout.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ fun TextInputLayout.content() = editText().text.toString()
4444
fun TextInputLayout.hasContent() = !editText().text.isNullOrEmpty()
4545

4646
fun TextInputLayout.clearErrorOnChange(lifecycleOwner: LifecycleOwner) {
47-
editText()
48-
.textChanges()
49-
.onEach { error = null }
50-
.launchIn(lifecycleOwner.lifecycleScope)
47+
onTextChange(lifecycleOwner) {
48+
error = null
49+
}
5150
}
5251

5352
fun TextInputLayout.onTextChange(lifecycleOwner: LifecycleOwner, action: (CharSequence) -> Unit) {

0 commit comments

Comments
 (0)