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

Datepicker: allow the removal of masking via a new option #6080

Closed
awbuboltz opened this issue Jan 31, 2022 · 7 comments · Fixed by #6142
Closed

Datepicker: allow the removal of masking via a new option #6080

awbuboltz opened this issue Jan 31, 2022 · 7 comments · Fixed by #6142
Assignees
Labels
team: lawson For lawson issues type: bug 🐛 type: patch [2] Velocity rating (Fibonacci)

Comments

@awbuboltz
Copy link
Contributor

awbuboltz commented Jan 31, 2022

Is your feature request related to a problem or use case? Please describe.
In the past (pre-4.51), we were able to use $elem.data('mask').destroy(); to effectively remove the masking from datepickers. That was an acceptable solution, but now that it's broken, we'd like to have something more permanently supported.

Describe the solution you'd like
A new datpicker option called something like { "useMask": false } that forgoes the addition of masking to the input field, allowing users to customize their own formatting.

Describe alternatives you've considered
One temporary solution I found with @EdwardCoyle was to add this.$elem.data('mask', null); after the destroy() call, which comes after initializing a datepicker. The reason this works is because

} else if (this.element.data('mask') === undefined) {
checks specifically for undefined, allowing null to pass though. For some reason, the entire mask is being set back up on blur, which seems wrong altogether, that gets called here: which is called by setCurrentCalendar() after the blur.

Additional context
Add any other context or screenshots about the feature request here.
And what application do you work on? [e.g. {Infor XYZ}]
Team: Lawson
Needed by: 4.61
@EdwardCoyle and I spent a good amount of time figuring this all out, so he's probably the guy for the job ;).

@awbuboltz awbuboltz changed the title Datepicker: Datepicker: allow the removal of masking via a new option Jan 31, 2022
@tmcconechy tmcconechy added [2] Velocity rating (Fibonacci) type: bug 🐛 labels Jan 31, 2022
@tmcconechy tmcconechy added this to To do in Enterprise 4.61.x (Feb 2022) Sprint via automation Jan 31, 2022
@tmcconechy
Copy link
Member

tmcconechy commented Jan 31, 2022

Feel free @EdwardCoyle - I think just a setting to not invoke the mask seems entirely appropriate

@awbuboltz
Copy link
Contributor Author

Note, this is team: lawson

@EdwardCoyle EdwardCoyle added the team: lawson For lawson issues label Feb 8, 2022
@EdwardCoyle
Copy link
Contributor

EdwardCoyle commented Feb 8, 2022

@tjamesallen15 two notes:

  • We should forego the temporary solution described above because...
  • this.mask(); probably shouldn't be called in setCurrentCalendar(), considering how often it can be called. You might also want to look into removing that as part of the PR for this issue, but it's unclear to me what the impact of that will be on any usage of Datepicker and Monthview components.

I think tasks for this issue are:

  • add the setting useMask and default it to true
  • tie the setting to invoking/destroying a mask component on the input
  • create an example/test for explicitly-unmasked datepicker fields

@kaeleding
Copy link

kaeleding commented Feb 10, 2022

Hi @tmcconechy, would like to ask an estimate for the 4.61 release date, since we are contemplating on applying the workaround on our end in line with our own release date.

It would be really helpful to us.

Thanks!

@tmcconechy
Copy link
Member

Would be march 5-10 (start of march)

@tmcconechy
Copy link
Member

Once completed will patch in 4.60.1

@tjamesallen15 tjamesallen15 moved this from To do to In progress in Enterprise 4.61.x (Feb 2022) Sprint Feb 22, 2022
@tmcconechy tmcconechy moved this from In progress to Pending Review in Enterprise 4.61.x (Feb 2022) Sprint Feb 24, 2022
@tmcconechy tmcconechy moved this from Pending Review to Ready for QA (beta) in Enterprise 4.61.x (Feb 2022) Sprint Mar 1, 2022
@jbrcna
Copy link
Contributor

jbrcna commented Mar 2, 2022

@jbrcna jbrcna moved this from Ready for QA (beta) to Done in Enterprise 4.61.x (Feb 2022) Sprint Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: lawson For lawson issues type: bug 🐛 type: patch [2] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants