Skip to content

Commit 5b29d0a

Browse files
committed
Hide calendarIcon if explicitly set to null
1 parent dd19fd9 commit 5b29d0a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/DateTimePicker.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,18 @@ export default class DateTimePicker extends PureComponent {
164164
{this.props.clearIcon}
165165
</button>
166166
)}
167-
<button
168-
className="react-datetime-picker__calendar-button react-datetime-picker__button__icon"
169-
disabled={disabled}
170-
onClick={this.toggleCalendar}
171-
onFocus={this.stopPropagation}
172-
onBlur={this.resetValue}
173-
type="button"
174-
>
175-
{this.props.calendarIcon}
176-
</button>
167+
{this.props.calendarIcon !== null && (
168+
<button
169+
className="react-datetime-picker__calendar-button react-datetime-picker__button__icon"
170+
disabled={disabled}
171+
onClick={this.toggleCalendar}
172+
onFocus={this.stopPropagation}
173+
onBlur={this.resetValue}
174+
type="button"
175+
>
176+
{this.props.calendarIcon}
177+
</button>
178+
)}
177179
</div>
178180
);
179181
}

0 commit comments

Comments
 (0)