.Net Maui OTP Input Control - clipboard paste support?
Hello - According to the Intro article, the new OTP Input Controls has clipboard paste support - Introducing the New .NET MAUI Toolkit OTP Input Control | Syncfusion Blogs. Is there an example of how to get this working? I can see any built-in events/properties to use.
Update - Paste work in Windows and Android, but it does not work on iOS (the app crashes).
Hi Tyler,
Thank you for contacting Syncfusion support.
Yes, we’re able to replicate the issue you mentioned—where the app crashes when pasting text into the SfOTPInput control on iOS and macOS. We've identified this as a platform-specific issue, and we will be addressing it at the source level.
The fix will be included in the upcoming .NET MAUI Toolkit release, and we’ll make sure to notify you once the updated version is available.
We appreciate your patience and understanding. Please let us know if you need any further assistance in the meantime.
Regards,
Kishore J
Is this resolved yet? I don't want to go with another OTP control or entry. I have your's perfectly wired up, but when iOS automatically picks up the OTP code from my email, I tap it, and it tries to paste it into the OTP control, it crashes the app. I am about to release my app (1.5 years of work) next week. I was hoping this would come through before, so...
Error Message:
System.FormatException
Message=String must be exactly one character long.
Stack Trace:
at System.Char.Parse(ReadOnlySpan1 s)
at System.Char.Parse(String s)
at Syncfusion.Maui.Toolkit.OtpInput.SfOtpInput.OnEntryTextChanged(Object sender, TextChangedEventArgs e)
at Microsoft.Maui.Controls.InputView.OnTextChanged(String oldValue, String newValue)
at Microsoft.Maui.Controls.InputView.<>c.<.cctor>b__96_0(BindableObject bindable, Object oldValue, Object newValue)
at Microsoft.Maui.Controls.BindableObject.OnBindablePropertySet(BindableProperty property, Object original, Object value, Boolean didChange, Boolean willFirePropertyChanged)
at Microsoft.Maui.Controls.Element.OnBindablePropertySet(BindableProperty property, Object original, Object value, Boolean changed, Boolean willFirePropertyChanged)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value, SetterSpecificity specificity)
at Microsoft.Maui.Controls.InputView.Microsoft.Maui.ITextInput.set_Text(String value)
at Microsoft.Maui.ITextInputExtensions.UpdateText(ITextInput textInput, String text)
at Microsoft.Maui.Handlers.EntryHandler.MauiTextFieldProxy.OnEditingChanged(Object sender, EventArgs e)
at UIKit.UIControlEventProxy.Activated() in /Users/builder/azdo/_work/1/s/macios/src/UIKit/UIControl.cs:line 39
at UIKit.UIControlEventProxy.__Registrar_Callbacks__.callback_1602_UIKit_UIControlEventProxy_Activated(IntPtr pobj, IntPtr sel, IntPtr* exception_gchandle)
Hi Tyler,
We have fixed the reported issue with the SfOTPInput control crashing on iOS when pasting text. This fix will be available in our upcoming toolkit release version 1.0.6, which is expected to be released in the first week of August 2025.
Thank you for your patience, and please let us know if you have any further questions or need assistance!
Regards,
Kishore J
Thank you, Michael
Hi Tyler,
We are pleased to inform you that the issue where the SfOTPInput control was crashing on iOS when pasting text has been resolved. This fix has been included in our latest Maui Toolkit release, v1.0.6, which is now available for download.
Thank you for your continued support and patience while we worked on this update. If you need any further assistance, please don’t hesitate to contact us!
Regards,
Kishore J
Hi, thank you for the update. I can confirm that the app no longer crashes when I tap the code above the keyboard in iOS (auto-fill by iOS) or even when I copy/paste the code from an email/SMS.
This bug fix resolves the issue where, in iOS, the 6-digit code, which can be copied from an email or SMS and pasted, now works. The paste method works across all six individual fields.
However, there is one use case that still fails. In iOS, if you use the auto-paste functionality (tapping the code that appears above your keyboard after it fetches it from your email/SMS), the OTP control seems to want to put all six digits in the first field, not across all six.
Hope this helps; I can provide a video if you need.
~Michael
Hi Michael,
Thank you for your detailed feedback and for describing the scenario. We tried to replicate the behavior you described on our side using the iOS Simulator:
- In our testing environment, the auto-paste feature (the gray auto-fill/code bar above the keyboard) does not appear in the Simulator when copying an OTP from a message—this seems to be due to simulator limitations.
- We attempted to utilize the autofill options by right-clicking on the OTP entry field. This opens a context menu (such as for pasting contact numbers), but when pasting a value this way, it throws an exception stating the input must be a single character (as shown in the demo video attached).
- To further investigate, we will also consider and test the behavior of these autofill/context menu options specifically on real devices, to see if the same or a different issue occurs.
Could you please clarify if the issue you are facing is specifically related to:
- The true iOS “auto-fill one time code” bar that appears above the keyboard after receiving an SMS/email on a physical device, or
- The autofill/context menu options displayed by right-clicking on the OTP field (either in Simulator or on a real device)?
- If possible, a screen recording of the exact behavior you are seeing would be extremely helpful for our analysis.
Thank you very much for your cooperation and assistance!
Regards,
Kishore J
Attachment: SfOtpInputDemo_6d7dfb2.zip
Thank you for the response and testing. Yes, you are correct the behavior of iOS tap to paste (numbers that auto-show above the keyboard), do not work on a simulator. You must have a real iOS device for testing this condition. I can paste the values in, that seems to work. But a LOT of people use the tap to paste as it's dummy proof, and just one tap. I will get a screen recording for you, sure.
Hi Michael,
Thank you for your update and clarification.
We have tried to replicate this issue using a simple sample on a real iPad device, but the keyboard does not show the copied text for tap-to-paste above the keyboard. If you are still experiencing this issue, could you please share a screen recording of the behavior and the device details? This will help us investigate further and provide a more targeted solution.
Thank you for your cooperation.
Regards,
Kishore J
- 11 Replies
- 3 Participants
-
TC Tyler Chessman
- Jun 8, 2025 10:11 PM UTC
- Aug 18, 2025 10:49 AM UTC