Skip to content

Commit

Permalink
fix(datepicker): alignment of days when outside="hidden" (#793)
Browse files Browse the repository at this point in the history
When outside days get hidden, they collapse in their flex context and change the alignment of the first days of the month. Adding flex-grow 1 ensures the hidden days still keep their space so the day labels on top match correctly with the calendar days.
  • Loading branch information
gfellerph authored Nov 22, 2022
1 parent 8ca017a commit ec49a1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-buses-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': patch
---

When outside days get hidden, they collapse in their flex context and change the alignment of the first days of the month. Adding flex-grow 1 ensures the hidden days still keep their space so the day labels on top match correctly with the calendar days.
4 changes: 4 additions & 0 deletions packages/styles/src/components/datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ span.ngb-dp-navigation-chevron {
.ngb-dp-day {
width: auto !important;
height: auto !important;

&.hidden {
flex-grow: 1;
}
}

.ngb-dp-day > .btn-light {
Expand Down

0 comments on commit ec49a1b

Please sign in to comment.