diff --git a/src/calendar_icon.jsx b/src/calendar_icon.jsx index 23264d5a3..01f21dd0e 100644 --- a/src/calendar_icon.jsx +++ b/src/calendar_icon.jsx @@ -22,7 +22,7 @@ const CalendarIcon = ({ icon, className }) => { // Default SVG Icon return ( diff --git a/src/stylesheets/datepicker.scss b/src/stylesheets/datepicker.scss index 581f4c1b2..137cf970a 100644 --- a/src/stylesheets/datepicker.scss +++ b/src/stylesheets/datepicker.scss @@ -513,6 +513,7 @@ .react-datepicker__calendar-icon { position: absolute; padding: 0.5rem; + box-sizing: content-box; } } diff --git a/test/datepicker_test.test.js b/test/datepicker_test.test.js index 6d8881766..9bdf33930 100644 --- a/test/datepicker_test.test.js +++ b/test/datepicker_test.test.js @@ -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", () => {