Skip to content

Commit

Permalink
[fix]: QA 후 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jinuemong committed Feb 3, 2024
1 parent 3832002 commit 63c8e3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class NumberCommaTransformation : VisualTransformation {
NumberFormat.getNumberInstance(Locale.US).format(this ?: 0)

override fun filter(text: AnnotatedString): TransformedText {
val newText = AnnotatedString(text.text.toLongOrNull().formatWithComma() + "")
val newText = AnnotatedString(
text = if (text.text.isEmpty()) "" else text.text.toLongOrNull().formatWithComma() + ""
)
return TransformedText(
text = newText,
offsetMapping = object : OffsetMapping {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ fun TypingPriceField(
innerPadding: PaddingValues = PaddingValues(0.dp),
textFieldHeight: Dp = 35.dp,
keyboardOptions: KeyboardOptions = KeyboardOptions(keyboardType = KeyboardType.NumberPassword),
textFormat : VisualTransformation = NumberCommaTransformation(),
fieldSubjectContent: (@Composable () -> Unit) = { FieldSubject() },
leadingIconContent: (@Composable () -> Unit)? = null,
trailingIconContent: (@Composable () -> Unit)? = null,
errorMessageContent: (@Composable () -> Unit) = { },
) {
val interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
val numberCommaTransFormation = remember { NumberCommaTransformation() }
val textFormat =
if (textValue.isEmpty()) VisualTransformation.None else numberCommaTransFormation
var isTextFieldFocused by remember { mutableStateOf(false) }
val scope = rememberCoroutineScope()
val currentColor = if (isError) Negative else if (isTextFieldFocused) Primary3 else Gray500
Expand Down

0 comments on commit 63c8e3f

Please sign in to comment.