Skip to content

Commit

Permalink
fix(DateInput): fix autofocus
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Sep 2, 2019
1 parent 9bfbd66 commit 5a6fcc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/DateInput/DateInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type DateInputProps = {
clearable?: boolean,
disabled?: boolean,
isMonthPicker?: boolean,
autoFocus?: boolean,
placeholder?: string,
};

Expand Down Expand Up @@ -133,7 +134,7 @@ class DateInput extends React.Component<DateInputProps, DateInputState> {
render() {
const collectedProps = this.collectProps();

const { value, withTime, withPortal, stretch, onChange, clearable, disabled, placeholder, isMonthPicker, ...rest } = this.props;
const { value, withTime, withPortal, stretch, onChange, clearable, disabled, placeholder, isMonthPicker, autoFocus, ...rest } = this.props;

const { textValue, isOpen } = this.state;
const mask = isMonthPicker ? utils.YEAR_MONTH_MASK : withTime ? utils.DATETIME_MASK : utils.DATE_MASK;
Expand All @@ -155,6 +156,7 @@ class DateInput extends React.Component<DateInputProps, DateInputState> {
onBlur={ this.onBlur }
clearable={ clearable }
disabled={ disabled }
autoFocus={ autoFocus }
/>
</Dropdown.Head>
<Dropdown.Body withPortal={ withPortal } modifiers={{
Expand Down

0 comments on commit 5a6fcc9

Please sign in to comment.