-
Notifications
You must be signed in to change notification settings - Fork 13.5k
fix(datetime): time picker display matches dynamically set value #25010
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
0aaf798
to
276edb4
Compare
9c02158
to
44aa2a2
Compare
Would it make sense here to post an updated dev build in the original issue? Wanted to check on that before I review since I noticed an old version of this PR didn't solve things for the OP. |
I can 👍 the stackblitz example there were using was also pointing to the latest, not the dev build (but the dev build contents have changed since then). The Playwright test is checking each condition (AM->AM, AM-PM, PM-AM, PM->PM) x20, so I do feel confident in the behavior more than with our puppeteer tests x4 execution. |
Dev build verified by issue reporter: #24967 (comment) |
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.
Not worrying about the cropped screenshots since you have that other PR up to fix those.
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
If you have a
ion-datetime
withpresentation="time"
and the initial value is in the "PM" and you attempt to update the value to "AM", the value will not update correctly.This is caused by the working parts not being updated when the value changes. The working parts are used for generating the available hour options, which will include the value being offset by 12, if the value is PM vs. AM. When dynamically setting the value, these options were not being generated correctly, so the resulting set of available hours would not match the current value and our fallback to scroll to the "zero" item would fire, updating the value to "12" PM.
Issue URL: #24967
What is the new behavior?
When updating the value of the datetime, the time picker will correctly display the value.
Does this introduce a breaking change?
Other information
Dev build:
6.0.15-dev.11649352526.165b8639
✅