-
Notifications
You must be signed in to change notification settings - Fork 77
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
Input-date-picker displays incorrect value if out-of-range #9282
Comments
**Related Issue:** #9282 ## Summary Ensure the initial value is within the min/max range. This is in line with the existing behavior, but it is not ideal. The plan is to stop automatically changing the value to the min/max when it is out of range, and rely on form constraint validation instead. However, doing so would be a breaking change, so it's on hold until v3. ## Verification notes The behavior after this is installed will look the same as the [repro sample](https://codepen.io/benelan/pen/VwOGwZy). The key is to check the value of the component in the form submission callback: ```js form.onsubmit = (event) => { console.log(event.target.elements["date-picker"].value); ... } ``` Here is an [updated repro sample](https://codepen.io/benelan/pen/dyBNVMx?editors=1111).
Installed and assigned for verification. |
Copied from the PR body:
|
@benelan to be clear the repro from the issue body submits the |
Yes, that's correct! |
🍡 Verified locally on |
**Related Issue:** #9282 ## Summary Ensure the initial value is within the min/max range. This is in line with the existing behavior, but it is not ideal. The plan is to stop automatically changing the value to the min/max when it is out of range, and rely on form constraint validation instead. However, doing so would be a breaking change, so it's on hold until v3. ## Verification notes The behavior after this is installed will look the same as the [repro sample](https://codepen.io/benelan/pen/VwOGwZy). The key is to check the value of the component in the form submission callback: ```js form.onsubmit = (event) => { console.log(event.target.elements["date-picker"].value); ... } ``` Here is an [updated repro sample](https://codepen.io/benelan/pen/dyBNVMx?editors=1111).
Check existing issues
Actual Behavior
An input-date-picker pre-populated with an out-of-range value displays the closest in-range value instead of the actual value. The
value
prop contains the out-of-range value. The out-of-range state is never reflected in the input'svalidity
and does not block form submissions.Expected Behavior
The input displays the out-of-range value with a
rangeOverflow
orrangeUnderflow
validity. Opening the picker should default the calendar selection to the closest in-range value. This should match how native date-pickers handle the same scenario.Reproduction Sample
https://codepen.io/nwhittaker-esri/pen/oNRvGqm
Reproduction Steps
min
instead of itsvalue
attributeReproduction Version
2.8.0
Relevant Info
No response
Regression?
No response
Priority impact
impact - p2 - want for an upcoming milestone
Impact
Field Maps allows users to edit meta data about form controls. As the meta data changes, the validity of a value can change. In those cases, we want the user to be able to identify the invalid data and correct it. For a date field that has become out-of-range, it can be confusing to see it marked as invalid but populated with an in-range value.
Calcite package
Esri team
ArcGIS Field Apps
The text was updated successfully, but these errors were encountered: