Skip to content

Commit

Permalink
Merge pull request #34 from guhcostan-equals/patch-1
Browse files Browse the repository at this point in the history
Adding id prop on input
  • Loading branch information
suweya authored Sep 2, 2020
2 parents fcd8fb8 + b7a3a9d commit 6556977
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class ReactCodeInput extends Component {
loading: PropTypes.bool,
title: PropTypes.string,
fieldWidth: PropTypes.number,
id: PropTypes.string,
fieldHeight: PropTypes.number,
autoFocus: PropTypes.bool,
className: PropTypes.string,
Expand Down Expand Up @@ -224,6 +225,7 @@ export default class ReactCodeInput extends Component {
key={`${this.id}-${index}`}
data-id={index}
value={value}
id={this.props.id ? `${this.props.id}-${index}` : null}
ref={this.iRefs[index]}
onChange={this.onChange}
onKeyDown={this.onKeyDown}
Expand Down

0 comments on commit 6556977

Please sign in to comment.