TP-39303 | remove line breakers (#158)
This commit is contained in:
committed by
GitHub
parent
f92431b2d4
commit
8cea20f15c
@@ -183,14 +183,19 @@ class CustomTextFieldRenderer(
|
||||
onDone = { keyboardController?.hide() }
|
||||
),
|
||||
value = inputValue,
|
||||
onValueChange = {
|
||||
if (!it.isInvalidInput(property.invalidCharRegex)) {
|
||||
onValueChange = { input ->
|
||||
val updatedInput = if (property.singleLine.orFalse()) {
|
||||
input.replace("\n"," ")
|
||||
} else {
|
||||
input
|
||||
}
|
||||
if (!updatedInput.isInvalidInput(property.invalidCharRegex)) {
|
||||
property.maxChar?.let { maxChar ->
|
||||
if (maxChar >= it.length) {
|
||||
inputValue = it
|
||||
if (maxChar >= updatedInput.length) {
|
||||
inputValue = updatedInput
|
||||
val transformedText = transformInput(
|
||||
property.valueTransformation,
|
||||
it
|
||||
updatedInput
|
||||
)
|
||||
customTextFieldData?.inputText = transformedText
|
||||
uiTronViewModel.handle[property.layoutId.getInputId()] =
|
||||
@@ -200,10 +205,10 @@ class CustomTextFieldRenderer(
|
||||
}
|
||||
}
|
||||
} ?: run {
|
||||
inputValue = it
|
||||
inputValue = updatedInput
|
||||
val transformedText = transformInput(
|
||||
property.valueTransformation,
|
||||
it
|
||||
updatedInput
|
||||
)
|
||||
customTextFieldData?.inputText = transformedText
|
||||
uiTronViewModel.handle[property.layoutId.getInputId()] =
|
||||
|
||||
Reference in New Issue
Block a user