In Android, when you insert a special character (ex: +, -, *, .) in a TextBox (the TextBox/mask needs to not be full/complete).
Ex: Mask is (00000)
The TextBox needs to have InputScope="TelephoneNumber"
When the mask is not full, you try to add a special character and the cursor moves to the left
When the mask is not full, you try to add a special character and the TextBox stays at the same position
Add a special character with the pad to the TextBox and the cursor will move one position to the left
Use the following sample: TextBoxFormattingSample.zip
Nuget Package:
Uno.UI = 2.0.512-dev.3599
Umbrella.View = 3.8.0-dev.414
Package Version(s):
Affected platform(s):
Visual Studio:
Relevant plugins:
https://dev.azure.com/nventive/Umbrella/_workitems/edit/164249
Why was this issue closed ? Was it fixed ?
I've changed the InputScope from Number to TelephoneNumber and the issue of flickering has stopped.
There's now an issue with the cursor moving left but it's related to Umbrella.
This issue can remain closed. The root cause is that the FormattingTextBoxBehavior, which not part of Uno.UI, simply re-adjusts cursor position based on the delta in text length, regardless of the modification(s) occurred before or after the cursor position:
var selectionStart = textbox.SelectionStart; if (textbox.Text.Length > formattedText.Length) // Non-considered special chars were removed. { selectionStart -= textbox.Text.Length - formattedText.Length; } else // String format chars were added. { selectionStart += GetAddedFormattingCharacterCount(textbox); }-- https://nventive.visualstudio.com/Umbrella/_workitems/edit/164249/
Most helpful comment
This issue can remain closed. The root cause is that the
FormattingTextBoxBehavior, which not part of Uno.UI, simply re-adjusts cursor position based on the delta in text length, regardless of the modification(s) occurred before or after the cursor position: