-
Notifications
You must be signed in to change notification settings - Fork 63
FORMS-13760 Date picker display value not working during prefill #1180
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
Conversation
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1180 +/- ##
=========================================
Coverage 80.75% 80.75%
Complexity 773 773
=========================================
Files 91 91
Lines 2110 2110
Branches 285 285
=========================================
Hits 1704 1704
Misses 252 252
Partials 154 154 ☔ View full report in Codecov by Sentry. |
| if (this.widgetObject.getValue() !== '') { | ||
| this._model.value = this.widgetObject.getValue(); | ||
| if (this.isActive()) { | ||
| this.widgetObject.setValue(model.value); |
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.
Why are we setting widget value in setting of model? Ideally this should be the job of updateValue not setModel
Earlier model value was being set via widget, you have al together removed that code..
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.
Earlier model value was being set via widget, you have al together removed that code
It was redundant because the model value is already established upon initializing the datePickerWidget. If you observe the third argument, it contains the model.
In the setModel function, the model already possesses the correct value from af-core. Consequently, setting the value again within the model was redundant, as the value remained unchanged, and updateState was not invoked in this context.
Ideally this should be the job of updateValue not setModel
Ideally, we should utilize updateValue. However, during prefill/initialize, updateValue lacks initialization of the widgetObject, resulting in failure. Although I considered making this change of initializing widgetObject in updateValue like we do in number input but it would require significant refactoring, which isn't necessary at this juncture.
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.
Can you open a JIRA to correct this flow, to align with other views. And do link that JIRA to the original issue so it could be tracked.
@review @vdua
DOD(Yes)
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: