Skip to content

Commit

Permalink
Fix #2158 - Added inputMode prop for Calendar (#2159)
Browse files Browse the repository at this point in the history
* Fix #2158 - Added inputMode prop for Calendar

* Refactor

* Refactor #2158

* Refactor #2158
  • Loading branch information
mcandu authored Jul 6, 2021
1 parent d45125b commit 1b3d272
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class Calendar extends Component {
inputId: null,
inputStyle: null,
inputClassName: null,
inputMode: null,
required: false,
readOnlyInput: false,
keepInvalid: false,
Expand Down Expand Up @@ -106,6 +107,7 @@ export class Calendar extends Component {
inputId: PropTypes.string,
inputStyle: PropTypes.object,
inputClassName: PropTypes.string,
inputMode: PropTypes.string,
required: PropTypes.bool,
readOnlyInput: PropTypes.bool,
keepInvalid: PropTypes.bool,
Expand Down Expand Up @@ -3053,7 +3055,7 @@ export class Calendar extends Component {
return (
<InputText ref={this.inputRef} id={this.props.inputId} name={this.props.name} type="text" className={this.props.inputClassName} style={this.props.inputStyle}
readOnly={this.props.readOnlyInput} disabled={this.props.disabled} required={this.props.required} autoComplete="off" placeholder={this.props.placeholder}
onInput={this.onUserInput} onFocus={this.onInputFocus} onBlur={this.onInputBlur} onKeyDown={this.onInputKeyDown} aria-labelledby={this.props.ariaLabelledBy} inputMode="none" />
onInput={this.onUserInput} onFocus={this.onInputFocus} onBlur={this.onInputBlur} onKeyDown={this.onInputKeyDown} aria-labelledby={this.props.ariaLabelledBy} inputMode={this.props.inputMode || 'none'} />
);
}

Expand Down
7 changes: 7 additions & 0 deletions src/showcase/calendar/CalendarDoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,20 @@ const monthNavigatorTemplate = (options) => {
<td>object</td>
<td>null</td>
<td>Inline style of the input element.</td>

</tr>
<tr>
<td>inputClassName</td>
<td>string</td>
<td>null</td>
<td>Style class of the input element.</td>
</tr>
<tr>
<td>inputMode</td>
<td>string</td>
<td>null</td>
<td>HTML inputmode attribute of input.</td>
</tr>
<tr>
<td>required</td>
<td>boolean</td>
Expand Down

0 comments on commit 1b3d272

Please sign in to comment.