Skip to content

Commit 2122df4

Browse files
Merge pull request #4298 from frankops11/main
Fix: Display Issue of Calendar Icon in React Date Picker (#4291)
2 parents 088e590 + bcc1dc3 commit 2122df4

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/calendar_icon.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const CalendarIcon = ({ icon, className }) => {
2222
// Default SVG Icon
2323
return (
2424
<svg
25-
className="react-datepicker__calendar-icon"
25+
className={`${defaultClass} ${className}`}
2626
xmlns="http://www.w3.org/2000/svg"
2727
viewBox="0 0 448 512"
2828
>

src/stylesheets/datepicker.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@
513513
.react-datepicker__calendar-icon {
514514
position: absolute;
515515
padding: 0.5rem;
516+
box-sizing: content-box;
516517
}
517518
}
518519

test/datepicker_test.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2234,7 +2234,7 @@ describe("DatePicker", () => {
22342234
datePicker,
22352235
"react-datepicker__calendar-icon",
22362236
).getAttribute("class");
2237-
expect(showIconClass).toBe("react-datepicker__calendar-icon");
2237+
expect(showIconClass).toMatch(/^react-datepicker__calendar-icon\s?$/);
22382238
});
22392239

22402240
describe("Year picker", () => {

0 commit comments

Comments
 (0)