-
Notifications
You must be signed in to change notification settings - Fork 14
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(sbb-calendar): vertical orientation #3378
base: main
Are you sure you want to change the base?
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.
Great job. Just a consideration about the fact that the width of the component depends on which month is currently in view, like in horizontal mode the height was changing, but in this case it can happen that you kinda have to chase the next month arrow around. Should this be addressed somehow? (maybe an empty column when necessary)
Also I think I might have a suggestion for a more efficient way to render the tables, but since it would have been a million comments (and I'm not 100% sure it would work) it's easier for me to try to implement it and show it to you
@@ -999,11 +1304,11 @@ class SbbCalendarElement<T = Date> extends SbbHydrationMixin(LitElement) { | |||
})} | |||
@click=${() => this._selectDate(day.value)} | |||
?disabled=${isOutOfRange || isFilteredOut} | |||
value=${day.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.
Is this a proper use for the button's value attribute, I feel like a custom attribute would be more suited for this scenario
Preflight Checklist
Issue
This PR Closes #3336
Pull request checklist
Please check if your PR fulfills the following requirements:
See Review Guidelines for more information what is checked during review process.
Changes
Changes in this pull request:
orientation
has been added on thesbb-calendar
, which accepthorizontal
(default) andvertical
as values;month
view;day
view, since it relies on calculation on the elements position (index of the element in the array of rendered cells). With vertical orientation the first rendered element is always the first Monday of the month and not the first day of the month. To fix this, thedata-day
attribute has been replaced with thevalue
which is filled with the day's corresponding date as ISO string. Keyboard navigation is now a date calculation;firstFocusable
calculation;Browsers
I tested the build on the following browsers:
Screen readers
I tested the build on the following browsers:
Pull request type
Please check the type of change your PR introduces:
Does this introduce a breaking change?
Other information