You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TextField/textChange - trying to do input formatting when text changes #10249
I have been trying to auto format TextField entry for phone# as 212-222-3333. So as the user types 212 it will add 212-and so on. But on iOS assigning the formatted text on textChange event, repeats the last entry.
So I created this Preview. The preview app tries to add a "-" after every input (just to simplify the concept) . So if we add "2" it should make it "2-". But instead in iOS the TextField makes it "2-2".
I have submitted this on the Discord/Help channel as well.
Thank you for reporting @sudiptosen and confirming @Nawalsubject - we're looking at posting a 8.5.1 update and will see about including anything needed here.
@sudiptosen@Nawalsubject this appears fixed on 8.5 already, see attached video. I noticed the package you shared is using 8.4 - After updating, if further issue, please post back with updated package.json and perhaps simulator details. This is from a iOS 16.2, iPhone 14 Pro...
changed the title [-]TextField/textChange - Repeats last character (iOS only Issue)[/-][+]TextField/textChange - trying to do input formatting when text changes[/+]on Apr 8, 2023
@Salvetori@sudiptosen@Nawalsubject I'm going to create a separate issue isolating just iOS 16.4 on this cause the original case involved formatting on textChange which the above addresses but the key detail is iOS 16.4 specifically behaves differently than 16.2: #10267
Thank you @Salvetori for clarifying this.
Activity
dammynex commentedon Apr 5, 2023
There's an issue with TextField on iOS it keeps truncating the last character input.
Screen.Recording.2023-04-05.at.4.03.43.AM.mov
Nawalsubject commentedon Apr 7, 2023
same problem here, very blocking
NathanWalker commentedon Apr 7, 2023
Thank you for reporting @sudiptosen and confirming @Nawalsubject - we're looking at posting a 8.5.1 update and will see about including anything needed here.
NathanWalker commentedon Apr 7, 2023
@sudiptosen @Nawalsubject this appears fixed on 8.5 already, see attached video. I noticed the package you shared is using 8.4 - After updating, if further issue, please post back with updated package.json and perhaps simulator details. This is from a iOS 16.2, iPhone 14 Pro...
ns-8-5-textfield.mov
feat(text): valueFormatter for versatile input auto-formatting
NathanWalker commentedon Apr 8, 2023
@sudiptosen @Nawalsubject After looking at your linked stackblitz, I was able to tell you were trying to do input formatting with
textChangewhich is possible but fairly tricky to get conditions right. The issue as reported wasn't related to a core issue but I ended up implementing a feature to make this easier for these cases which you can now find in this StackBlitz which is based off of yours:https://stackblitz.com/edit/nativescript-textfield-value-formatter?file=src%2Fapp%2Fitem%2Fitems.component.html
It uses
8.5.1-rc.3which includes the newvalueFormatterfeature to make your case simpler. Core patch likely to be released this upcoming week.[-]TextField/textChange - Repeats last character (iOS only Issue)[/-][+]TextField/textChange - trying to do input formatting when text changes[/+]Salvetori commentedon Apr 8, 2023
the issue persists on iOS 16.4— specifically
textChangeis called twice on input, and the first backspace in aTextFieldignores the eventNathanWalker commentedon Apr 13, 2023
@Salvetori @sudiptosen @Nawalsubject I'm going to create a separate issue isolating just iOS 16.4 on this cause the original case involved formatting on textChange which the above addresses but the key detail is iOS 16.4 specifically behaves differently than 16.2: #10267
Thank you @Salvetori for clarifying this.
NathanWalker commentedon Apr 14, 2023
Confirmed iOS 16.4 is actually ok too - see #10267 - can post anything further on that issue if you all find otherwise.