Skip to content

Commit 8b507b3

Browse files
committed
Custom input attributes
I’m adding this because I need to add custom attributes to the input element so that I can meet accessibility requirements and do automated testing.
1 parent e44fda3 commit 8b507b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DateTimeField.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ DateTimeField = React.createClass({
1313
dateTime: React.PropTypes.string,
1414
onChange: React.PropTypes.func,
1515
format: React.PropTypes.string,
16-
inputFormat: React.PropTypes.string
16+
inputFormat: React.PropTypes.string,
17+
inputProps: React.PropTypes.object
1718
},
1819
getDefaultProps: function() {
1920
return {
@@ -285,7 +286,7 @@ DateTimeField = React.createClass({
285286
togglePeriod={this.togglePeriod}
286287
/>
287288
<div className="input-group date" ref="datetimepicker">
288-
<input type="text" className="form-control" onChange={this.onChange} value={this.state.inputValue} />
289+
<input type="text" className="form-control" onChange={this.onChange} value={this.state.inputValue} {...this.props.inputProps}/>
289290
<span className="input-group-addon" onClick={this.onClick} onBlur={this.onBlur} ref="dtpbutton"><Glyphicon glyph="calendar" /></span>
290291
</div>
291292
</div>

0 commit comments

Comments
 (0)