Closed martintreurnicht closed 3 years ago
Hey @martintreurnicht Thanks for your effort.
Still, it seems like you haven’t checked on our known issues closely.
For instance, #54
Also, at a glance I already can tell your pull request while somewhat curing an existing issue, might introduce a new bug with spaces always being erased, even in those cases when a space char might actually be required.
Hey @martintreurnicht Thanks for your effort.
Still, it seems like you haven’t checked on our known issues closely.
For instance, #54
Also, at a glance I already can tell your pull request while somewhat curing an existing issue, might introduce a new bug with spaces always being erased, even in those cases when a space char might actually be required.
@taflanidi Yeah i see your point. I guess we could dial it in more specifically. We could check that if the empty space is replacing the full content of the input, and we probably don't need to trim the content here either, we'll just replace it on the second call. Then there would be no risk, as the input mask would never need to format a single empty character.
Let me look into this. And yes i agree that this is stupid from apple, why are they not using their own api? replacementString
+ range
would be perfect way to do this. In reality it's no different from copy paste (which does work by the way) the only difference is it would replace the full content of the input which could be indicated with range, but here we are...
Great!
Let me look into this.
A couple of things to be considered.
First, there are three classes to take care of, not only the MaskedTextFieldDelegate
, but also MaskedTextInputListener
and MaskedTextViewDelegate
. Though UITextView
does not support suggestions, IIRC.
Second, a toggle switch variable for turning this workaround off altogether is a must. Just like this one.
Great!
Let me look into this.
A couple of things to be considered.
First, there are three classes to take care of, not only the
MaskedTextFieldDelegate
, but alsoMaskedTextInputListener
andMaskedTextViewDelegate
. ThoughUITextView
does not support suggestions, IIRC.Second, a toggle switch variable for turning this workaround off altogether is a must. Just like this one.
@taflanidi I've made the changes discussed here, only change i didn't make is to MaskedTextInputListener
. It doesn't seem like we need to do anything here, we just need to handle the cases where we are returning false, which causes the second call with the suggested text to be cancelled. Seems like the changes made should be good.
I've also added the toggle you suggested, switched on by default, but let me know if you want me to switch to off by default
Nice! Thanks a lot.
I'm going to have those changes published till the end of the week. My current workload is quite overloaded these days…
Hey @martintreurnicht
I've added you to our README, if you don't mind.
--------------------------------------------------------------------------------
🎉 Congrats
🚀 InputMask (6.1.0) successfully published
📅 February 15th, 02:51
🌎 https://cocoapods.org/pods/InputMask
👍 Tell your friends!
--------------------------------------------------------------------------------
Breaks react-native-text-input-mask https://github.com/react-native-text-input-mask/react-native-text-input-mask/issues/216
When entering values from suggestions, it gets ignored