mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Supress warning ModifierComposed for autofill, there is a low risk of performance issue here.
This commit is contained in:
committed by
Benoit Marty
parent
000bcb448c
commit
07ca064ac4
+10
-4
@@ -201,11 +201,14 @@ private fun LoginForm(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.onTabOrEnterKeyFocusNext(focusManager)
|
.onTabOrEnterKeyFocusNext(focusManager)
|
||||||
.testTag(TestTags.loginEmailUsername)
|
.testTag(TestTags.loginEmailUsername)
|
||||||
.autofill(autofillTypes = listOf(AutofillType.Username), onFill = {
|
.autofill(
|
||||||
|
autofillTypes = listOf(AutofillType.Username),
|
||||||
|
onFill = {
|
||||||
val sanitized = it.sanitize()
|
val sanitized = it.sanitize()
|
||||||
loginFieldState = sanitized
|
loginFieldState = sanitized
|
||||||
eventSink(LoginPasswordEvents.SetLogin(sanitized))
|
eventSink(LoginPasswordEvents.SetLogin(sanitized))
|
||||||
}),
|
}
|
||||||
|
),
|
||||||
placeholder = {
|
placeholder = {
|
||||||
Text(text = stringResource(CommonStrings.common_username))
|
Text(text = stringResource(CommonStrings.common_username))
|
||||||
},
|
},
|
||||||
@@ -247,11 +250,14 @@ private fun LoginForm(
|
|||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.onTabOrEnterKeyFocusNext(focusManager)
|
.onTabOrEnterKeyFocusNext(focusManager)
|
||||||
.testTag(TestTags.loginPassword)
|
.testTag(TestTags.loginPassword)
|
||||||
.autofill(autofillTypes = listOf(AutofillType.Password), onFill = {
|
.autofill(
|
||||||
|
autofillTypes = listOf(AutofillType.Password),
|
||||||
|
onFill = {
|
||||||
val sanitized = it.sanitize()
|
val sanitized = it.sanitize()
|
||||||
passwordFieldState = sanitized
|
passwordFieldState = sanitized
|
||||||
eventSink(LoginPasswordEvents.SetPassword(sanitized))
|
eventSink(LoginPasswordEvents.SetPassword(sanitized))
|
||||||
}),
|
}
|
||||||
|
),
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
val sanitized = it.sanitize()
|
val sanitized = it.sanitize()
|
||||||
passwordFieldState = sanitized
|
passwordFieldState = sanitized
|
||||||
|
|||||||
+1
@@ -213,6 +213,7 @@ private fun TextFieldValueContentToPreview() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("ModifierComposed")
|
||||||
@OptIn(ExperimentalComposeUiApi::class)
|
@OptIn(ExperimentalComposeUiApi::class)
|
||||||
fun Modifier.autofill(autofillTypes: List<AutofillType>, onFill: (String) -> Unit) = composed {
|
fun Modifier.autofill(autofillTypes: List<AutofillType>, onFill: (String) -> Unit) = composed {
|
||||||
val autofillNode = AutofillNode(autofillTypes, onFill = onFill)
|
val autofillNode = AutofillNode(autofillTypes, onFill = onFill)
|
||||||
|
|||||||
Reference in New Issue
Block a user