Skip to content

Commit d872eed

Browse files
author
feba.baby
committed
Calender icon fix #3525
1 parent 34a33b5 commit d872eed

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/index.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,14 @@ export default class DatePicker extends React.Component {
11781178
renderInputContainer() {
11791179
return (
11801180
<div className="react-datepicker__input-container">
1181+
<svg
1182+
className="react-datepicker__calender-icon"
1183+
xmlns="http://www.w3.org/2000/svg"
1184+
viewBox="0 0 448 512"
1185+
onClick={this.renderDateInput()}
1186+
>
1187+
<path d="M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 96 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z" />
1188+
</svg>
11811189
{this.renderAriaLiveRegion()}
11821190
{this.renderDateInput()}
11831191
{this.renderClearButton()}

src/stylesheets/datepicker.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,13 @@
517517
position: relative;
518518
display: inline-block;
519519
width: 100%;
520+
.react-datepicker__calender-icon {
521+
position: absolute;
522+
padding: 0.5rem;
523+
}
524+
input {
525+
padding: 6px 10px 5px 25px;
526+
}
520527
}
521528

522529
.react-datepicker__year-read-view,
@@ -701,3 +708,9 @@
701708
width: 1px;
702709
white-space: nowrap;
703710
}
711+
712+
.react-datepicker__calender-icon {
713+
width: 1em;
714+
height: 1em;
715+
vertical-align: -0.125em;
716+
}

0 commit comments

Comments
 (0)