-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missed mask with null value #228
Conversation
@LastDreamer What issue does it solve? |
@LastDreamer as far I understand it fixes not displaying mask in keyboard mode, when passed null, but if the value would be null after processing by moment? |
@cherniavskii when i show picker with keyboard and mask options, but without default value (value equal null, because i need to picker be empty) - mask will no applied to picker, and i may input anything. PR solves this issue. |
@LastDreamer Okay, I see. P.S. In the future, please open an issue with bug description and reproducible example along with PR, which fixes this issue - this way it's clear what issue PR aims to solve and we'll have bug reports history ;) |
@cherniavskii In non-keyboard mode mask will not be applied, because we don't need this. |
@LastDreamer Well, right now mask works just fine in non-keyboard mode, and I don't see any reason to drop this support. |
@cherniavskii may you describe the case in which you need a input mask in non-keyboard mode? |
Personally, I don't use mask at all. After some experiments, it looks like using mask in non-keyboard mode doesn't really make a lot of sense. I'm curious to hear what @dmtrKovalenko thinks about that. That being said. if we decide to drop this support - we should document it and mention in breaking changes. |
Here's an example: https://codesandbox.io/s/y3pw19wjrj |
As far I know in fact mask is not affect anything on rendering and displaying empty fields, so even somebody using mask with an optional keyboard toggle (switch that changes keyboard mode) would not be a breaking change, because when the keyboard is on mask would be applied, its just may cause unnecessary rerender of react text mask. Am I right? |
yes, but if keyboard is off, mask wouldn't be applied Do you think |
From where I stand in this case mask displaying just make sense to show date format and only. |
I don't understand reason to toggle keyboard mode - but if it will - additional rendering will happen. Example above imo most people will write using format prop. |
@LastDreamer let's mention in docs that |
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
No description provided.