-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat(datetime): add preferWheel support for date presentation #25422
Conversation
Outstanding question: Say you have August 31st selected. You then change the month to June, which only has 30 days. What should happen to your previous "31st" selection? Currently, it resets you to the 1st, but not sure that's the correct behavior here. Maybe it should reset you to the nearest item? |
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.
Ran locally and the primary behavior looks great, nice job!
Is this layout shifting something we need to address?
Kapture.2022-06-08.at.13.41.52.mp4
I believe it is happening because the max range (October) doesn't render double digits for the days column, so the width is different when changing between the available months.
Setting a minimum width on the picker column fixes the issue. I have it applied only to ion-datetime, but maybe it would be good to set this on the picker column component? |
I think it makes sense in the |
I think resetting to the nearest item would feel better -- if you're on the 31st, you probably intend to pick something late in the month anyway -- although I recall there being issues when we tried to implement that in the context of interactions with min/max. 🤔 |
Makes sense. I'll keep the behavior for now and do some more investigation next sprint. |
Note: Playground docs will be done in a separate PR once all functionality is complete.
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.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?
Issue URL: Part of #23981
What is the new behavior?
presentation="date"
. Intended behavior can be found on the design doc for this feature.Does this introduce a breaking change?
Other information