Skip to content

Commit

Permalink
Merge pull request #4298 from frankops11/main
Browse files Browse the repository at this point in the history
Fix: Display Issue of Calendar Icon in React Date Picker (#4291)
  • Loading branch information
martijnrusschen committed Oct 9, 2023
2 parents 088e590 + bcc1dc3 commit 2122df4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/calendar_icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const CalendarIcon = ({ icon, className }) => {
// Default SVG Icon
return (
<svg
className="react-datepicker__calendar-icon"
className={`${defaultClass} ${className}`}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"
>
Expand Down
1 change: 1 addition & 0 deletions src/stylesheets/datepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@
.react-datepicker__calendar-icon {
position: absolute;
padding: 0.5rem;
box-sizing: content-box;
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/datepicker_test.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ describe("DatePicker", () => {
datePicker,
"react-datepicker__calendar-icon",
).getAttribute("class");
expect(showIconClass).toBe("react-datepicker__calendar-icon");
expect(showIconClass).toMatch(/^react-datepicker__calendar-icon\s?$/);
});

describe("Year picker", () => {
Expand Down

0 comments on commit 2122df4

Please sign in to comment.