Skip to content

Commit

Permalink
fix(datepicker): showCalendar no longer triggers if readOnly is true
Browse files Browse the repository at this point in the history
originally fixed by @benhancockco on #42
  • Loading branch information
arthurdenner committed Oct 3, 2019
1 parent 4ac0dc2 commit 6f4d13a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/datepicker.tsx
Expand Up @@ -344,7 +344,7 @@ class SemanticDatepicker extends React.Component<
selectedDateFormatted,
typedValue,
} = this.state;
const { clearable, locale, pointing, filterDate } = this.props;
const { clearable, locale, pointing, filterDate, readOnly } = this.props;
return (
<div className="field" style={style} ref={this.el}>
<Input
Expand All @@ -353,7 +353,7 @@ class SemanticDatepicker extends React.Component<
onBlur={this.handleBlur}
onChange={this.handleChange}
onClear={this.resetState}
onClick={this.showCalendar}
onClick={readOnly ? null : this.showCalendar}
onKeyDown={this.handleKeyDown}
value={typedValue || selectedDateFormatted}
/>
Expand Down

0 comments on commit 6f4d13a

Please sign in to comment.