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
searched StackOverflow's input-mask tag for similar problems.
Describe the bug
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString replaceCharactersInRange:withString:]: Range or index out of bounds' in MaskedTextFieldDelegate.swift class.
Steps to reproduce the behaviour:
Create an instance of UITextField with default properties, listener (MaskedTextFieldDelegateListener) and delegate (MaskedTextFieldDelegate)
1.1. The delegate should be an instance with primaryFormat: "[000000]"(for example [000000], but it can be either [00] or [000] etc.). The main point is that it should have some kind of symbols limitation.
Copy more than 6 symbols in clipboard (depend on the number of zeros in the format [000000]).
Run the application and navigate to the our UITextField.
Perform *three-finger gesture on the UITextField and tap Paste button (Screenshot 1) twice. The size limit should be exceeded, but everything will be ok.
And finally press the Undo button (Screenshot 1).
Crash!
I have made some analysis of this issue and draw conclusions which are depicted on Screenshot 2. Thank you for your cooperation in advance.
Expected behaviour
The delegate should perform the undo operation, if possible, otherwise make nothing.
Actual behaviour
Terminating app due to "Range or index out of bounds" exception.
Screenshots
Screenshot 1
Screenshot 2
Platform information
OS version: iOS 13.0+
Library version: 6.0
Language: Swift 5.0
Device (if bug is device-specific): iPhone7\8\X
Additional context *iOS provides built-in gestures for undo, redo, copy, and paste in text views, triggered using a variety of three-finger moves – swiping left and right, or pinching in or out respectively:https://www.apple.com/ios/ios-13/features/
The text was updated successfully, but these errors were encountered:
Prerequisites
X
between the brackets on this line if you have done all of the following:input-mask
tag for similar problems.Describe the bug
*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[__NSCFString replaceCharactersInRange:withString:]:
Range or index out of bounds' inMaskedTextFieldDelegate.swift
class.Steps to reproduce the behaviour:
UITextField
with default properties, listener (MaskedTextFieldDelegateListener
) and delegate (MaskedTextFieldDelegate
)1.1. The delegate should be an instance with
primaryFormat: "[000000]"
(for example[000000]
, but it can be either[00]
or[000]
etc.). The main point is that it should have some kind of symbols limitation.[000000]
).UITextField
.UITextField
and tapPaste
button (Screenshot 1) twice. The size limit should be exceeded, but everything will be ok.Undo
button (Screenshot 1).I have made some analysis of this issue and draw conclusions which are depicted on Screenshot 2. Thank you for your cooperation in advance.
Expected behaviour
The delegate should perform the undo operation, if possible, otherwise make nothing.
Actual behaviour
Terminating app due to "Range or index out of bounds" exception.
Screenshots
Screenshot 1
Screenshot 2
Platform information
Additional context
*iOS provides built-in gestures for undo, redo, copy, and paste in text views, triggered using a variety of three-finger moves – swiping left and right, or pinching in or out respectively: https://www.apple.com/ios/ios-13/features/
The text was updated successfully, but these errors were encountered: