Skip to content
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

Merged
merged 2 commits into from
Feb 27, 2018
Merged

Fix missed mask with null value #228

merged 2 commits into from
Feb 27, 2018

Conversation

LastDreamer
Copy link
Contributor

No description provided.

@cherniavskii
Copy link
Member

cherniavskii commented Feb 25, 2018

@LastDreamer What issue does it solve?

@dmtrKovalenko
Copy link
Member

@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?

@LastDreamer
Copy link
Contributor Author

@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.

@cherniavskii
Copy link
Member

@LastDreamer Okay, I see.
But what about non-keyboard mode?
With proposed changes, null will be passed in case of keyboard === false.

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 ;)

@LastDreamer
Copy link
Contributor Author

LastDreamer commented Feb 26, 2018

@cherniavskii In non-keyboard mode mask will not be applied, because we don't need this.
Input mask - keyboard only feature

@cherniavskii
Copy link
Member

@LastDreamer Well, right now mask works just fine in non-keyboard mode, and I don't see any reason to drop this support.

@LastDreamer
Copy link
Contributor Author

LastDreamer commented Feb 26, 2018

@cherniavskii may you describe the case in which you need a input mask in non-keyboard mode?

@cherniavskii
Copy link
Member

Personally, I don't use mask at all.
But it's possible to use mask for formatting right now. Removing this support is breaking change and potentially may break something for other people.
Also, there's no any info about using keyboard/mask together in docs.

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.

@cherniavskii
Copy link
Member

Here's an example: https://codesandbox.io/s/y3pw19wjrj

@dmtrKovalenko
Copy link
Member

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?

@cherniavskii
Copy link
Member

because when the keyboard is on mask would be applied

yes, but if keyboard is off, mask wouldn't be applied

Do you think mask property has any sense in case of keyboard === false?

@dmtrKovalenko
Copy link
Member

From where I stand in this case mask displaying just make sense to show date format and only.

@LastDreamer
Copy link
Contributor Author

LastDreamer commented Feb 26, 2018

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.

@cherniavskii
Copy link
Member

@LastDreamer let's mention in docs that mask only works together with keyboard prop - and we'll be able to merge this.

@LastDreamer
Copy link
Contributor Author

done

Copy link
Member

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@dmtrKovalenko dmtrKovalenko merged commit aa225d3 into mui:develop Feb 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants