Closed CFIFok closed 1 year ago
Hey @CFIFok! Thanks a lot for you heaven-of-a-detailed cool report, things like this massively assist with debugging.
Speaking of which, we'll have an update this week with a few tweaks, and I'd like to include the fix for this bug as well.
Any updates ?
Update is coming in 7.2.0
:D
That's a marvelous catch, thank you so much!
@CFIFok mind if I add you to our contributors?
Meet 7.2.0
.
@taflanidi yep sure! Thanx a lot too 👍
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 withprimaryFormat: "[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/