Skip to content

Commit 87a7f2f

Browse files
committed
Code style improvement
1 parent e18a289 commit 87a7f2f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

WooCommerce/Classes/ViewRelated/ReusableViews/TextFieldTableViewCell.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ private extension TextFieldTableViewCell {
4848

4949
private extension TextFieldTableViewCell {
5050
@objc func textFieldDidChange(textField: UITextField) {
51-
let formattedText = viewModel?.inputFormatter?.format(input: textField.text) ?? textField.text
51+
guard let formattedText = viewModel?.inputFormatter?.format(input: textField.text) else {
52+
onTextChange?(textField.text)
53+
return
54+
}
5255
textField.text = formattedText
5356
onTextChange?(formattedText)
5457
}

0 commit comments

Comments
 (0)