Skip to content

Commit

Permalink
fix: properly hide outside dates
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptammergard committed Nov 6, 2023
1 parent 9307489 commit 53a1b38
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/tender-dancers-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@einride/ui-dates": patch
"@einride/ui": patch
---

Properly hide outsides dates.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export const DatePickerInput = ({
<StyledDatePickerInput
ariaLabels={{ previousMonth: "Previous month", nextMonth: "Next month" }}
hasLabel={"label" in props}
hideOutsideDates
maxLevel="month"
popoverProps={{ clickOutsideEvents: ["pointerdown"] }} // to ensure popover is closed when clicking on a menu trigger
valueFormat={inputFormat}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const DateRangePickerInput = ({
color: ${theme.colors.content.positive};
}
&[data-outside] {
display: none;
display: none; // TODO: use hideOutsideDates instead when bug is fixed in Mantine
}
&[data-in-range]:not([data-selected]) {
background: ${theme.colors.background.tertiary};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export const DatePicker = ({
ariaLabels={{ previousMonth: "Previous month", nextMonth: "Next month" }}
hasLabel={"label" in props}
maxLevel="month"
hideOutsideDates
popoverProps={{ clickOutsideEvents: ["pointerdown"] }} // to ensure popover is closed when clicking on a menu trigger
valueFormat={inputFormat}
withAsterisk={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const DateRangePicker = ({
color: ${theme.colors.content.positive};
}
&[data-outside] {
display: none;
display: none; // TODO: use hideOutsideDates instead when bug is fixed in Mantine
}
&[data-in-range]:not([data-selected]) {
background: ${theme.colors.background.tertiary};
Expand Down

0 comments on commit 53a1b38

Please sign in to comment.