Read the original article:TextInput sets mobile phone number format input - How to solve the issue of cursor position disorder after modifying data? Problem Description Using HarmonyOS TextInput to enter phone numbers formatted as 3-4-4 via onChange() leads to two issues in practice: Spaces can be deleted. On delete/insert, the cursor jumps to the end. Current Effect For the number 123 4567 8910, the space between 7 and 8 was removed. The TextInput space was first deleted, followed by a refresh of the value, displaying: 123 4567 8910, with the cursor positioned at the end. Expected Outcome: For the number 123 4567 8910, the space between 7 and 8 was removed, effectively deleting the digit 7, resulting in the display: 123 4568 910, with the cursor positioned after the digit 6. Delete the number 6, display 123 4578 910, with the cursor positioned after the number 5. Background Knowledge TextInput is a single-line text input component.…