Skip to content

Commit

Permalink
Do not call input.focus if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed Jul 7, 2018
1 parent 272b506 commit f80ad2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DayPickerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ export default class DayPickerInput extends React.Component {
handleOverlayFocus(e) {
e.preventDefault();
this.overlayHasFocus = true;
if (!this.props.keepFocus) {
if (!this.props.keepFocus || typeof this.input.focus !== 'function') {
return;
}
this.input.focus();
Expand Down

0 comments on commit f80ad2e

Please sign in to comment.