-
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 multiple date selection #25514
Conversation
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.
General questions around the experience:
After deselecting a date that was previous selected, the day remains active, if you hover away to a different day:
I compared against Mobiscroll and there's remains active until you hover off the date cell. It does feel strange that it remains active until clicking off.
Now that we can select multiple days in the same month, the active ring has the ability to collide with a selected cell (visually). Should we adjust the design at all?
The functional behavior looks great though 🎉
* If `true`, multiple dates can be selected at once. Only | ||
* applies to `presentation="date"` and `preferWheel="false"`. | ||
*/ | ||
@Prop() multiple = false; |
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.
~ Noticed that 1/2 of our implementations have a default value and the other set the value to false
. Unsure if any action is needed here, but we should probably land on consistency in the next major.
For example:
- AccordionGroup, Input - multiple is unset
- Select - multiple defaults to false
This does affect the type signatures that are generated, but I am unsure of the impact of the field being marked as optional vs. required from the devs perspective.
Hmm... the faded circle around focused days shows you where you are when using keyboard navigation, so changing how that behaves may get confusing 🤔 Mobiscroll shows an entirely different circle (a gray outline) when using the keyboard. I'm okay with everything how it is, since it balances form and function in my eyes, but I could be persuaded otherwise. |
/** | ||
* The value of the datetime as a valid ISO 8601 datetime string. | ||
* Will be an array of strings if `multiple="true"`. |
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.
This is confusing since this is the prop that users manually set. Does this mean that datetime will automatically convert 2022-06-01
to ['2022-06-01']
when multiple="true"
? Or is this meant to indicate that the value
in the ionChange
payload will be an array?
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.
Hmm... more the ionChange
piece, though it also applies to the value
you can access via e.g. datetimeEl.value
. I think saying "should" instead of "will" gets closer to what I meant.
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.
Great job -- this is good to go once the below comments are addressed.
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?
Only one date can be selected at a time.
Issue URL: Resolves #24674
What is the new behavior?
New
multiple
prop added, allowing for multiple date selection whenpresentation="date"
. See internal design doc for full description of functionality.Does this introduce a breaking change?
Other information
Dev build:
6.1.14-dev.11657720710.1df41c89
PR for playground: ionic-team/ionic-docs#2442