iOS Question Strange text_changed behaviour


Active Member
Licensed User
I have a requirement for a TextField to only accept integers. So I set:
and to remove any typed decimal points I have the sub:
Sub TextField1_TextChanged (OldText As String, NewText As String)
    If NewText.IndexOf(".")<>-1 Then
        TextField1.Text="" 'no idea why this line is necessary
    End If
End Sub

If I don't include the line TextField1.Text="" the decimal point doesn't get removed but with that line (actually it can be setting .Text to any value as long as its not OldText) then it works as expected. It seems that the text field needs to be set to a different value before the system spots that the value should be changed back to OldText. With B4A it works as expected and the TextField1.Text="" line is not necessary.

Is this expected behaviour for B4i?