TP-35920 DOB field not getting pre-filled with latest Ui-tron version (1.0.9-20230718.121448-36) (#129)
This commit is contained in:
@@ -2515,13 +2515,13 @@
|
||||
"data": {
|
||||
"dob_new": {
|
||||
"viewType": "MultiSectionTextField",
|
||||
"value": "",
|
||||
"inputText": "2000-06-25",
|
||||
"hint": [
|
||||
"DD",
|
||||
"MM",
|
||||
"YYYY"
|
||||
],
|
||||
"dateFormat": "ddMMyyyy",
|
||||
"dateFormat": "yyyy-MM-dd",
|
||||
"dateSeparator": " - ",
|
||||
"onValueChangeAction": {
|
||||
"actions": [
|
||||
@@ -10043,8 +10043,7 @@
|
||||
"data": {
|
||||
"dob_new": {
|
||||
"viewType": "MultiSectionTextField",
|
||||
"value": "",
|
||||
"dateFormat": "ddMMyyyy",
|
||||
"inputText": "1234123412341234",
|
||||
"hint": [
|
||||
"XXXX",
|
||||
"XXXX",
|
||||
|
||||
@@ -27,6 +27,9 @@ import com.navi.uitron.utils.ShapeUtil
|
||||
import com.navi.uitron.viewmodel.UiTronViewModel
|
||||
import getBorderStrokeBrushData
|
||||
import getDataId
|
||||
import getFormattedDate
|
||||
import getFormattedMonth
|
||||
import getFormattedYear
|
||||
import getInputId
|
||||
import getInteractionType
|
||||
import getKeyboardOptions
|
||||
@@ -87,11 +90,18 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
mutableStateOf(property.textFieldPropertyList.sumOf { it.maxChar ?: 0 })
|
||||
}
|
||||
|
||||
val inputList: List<String> = if (totalChar.value == inputText.length) {
|
||||
splitStringIntoUnequalParts(inputText, defaultMaxCharList)
|
||||
} else {
|
||||
defaultMaxCharList.map { "" }
|
||||
}
|
||||
val inputList: List<String> =
|
||||
if (multiSectionTextFieldData?.dateFormat.isNotNullAndNotEmpty()) {
|
||||
listOf(
|
||||
getFormattedDate(inputText, multiSectionTextFieldData?.dateFormat),
|
||||
getFormattedMonth(inputText, multiSectionTextFieldData?.dateFormat),
|
||||
getFormattedYear(inputText, multiSectionTextFieldData?.dateFormat)
|
||||
)
|
||||
} else if (totalChar.value == inputText.length) {
|
||||
splitStringIntoUnequalParts(inputText, defaultMaxCharList)
|
||||
} else {
|
||||
defaultMaxCharList.map { "" }
|
||||
}
|
||||
|
||||
val inputValues = remember {
|
||||
(0 until property.textFieldPropertyList.size).map {
|
||||
@@ -194,15 +204,11 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
focusRequesters
|
||||
.getOrNull(index + 1)
|
||||
?.requestFocus()
|
||||
if (index < property.textFieldPropertyList.size - 1 &&
|
||||
maxCharList[index + 1] > inputValues[index + 1].value.text.length &&
|
||||
inputValues[index + 1].value.text.isEmpty()
|
||||
) {
|
||||
inputValues[index + 1].value =
|
||||
TextFieldValue(
|
||||
text = lastInput + inputValues[index + 1].value.text,
|
||||
selection = TextRange(maxCharList[index + 1])
|
||||
)
|
||||
if (index < property.textFieldPropertyList.size - 1 && maxCharList[index + 1] > inputValues[index + 1].value.text.length && inputValues[index + 1].value.text.isEmpty()) {
|
||||
inputValues[index + 1].value = TextFieldValue(
|
||||
text = lastInput + inputValues[index + 1].value.text,
|
||||
selection = TextRange(maxCharList[index + 1])
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user