Skip to content

Commit 431a942

Browse files
committed
✨ Update demo
1 parent 4b2f3bc commit 431a942

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/demo/index.jsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Demo extends Component {
1212
separator: '-',
1313
isDisabled: false,
1414
hasErrored: false,
15+
isInputNum: false,
1516
};
1617
}
1718

@@ -34,7 +35,7 @@ class Demo extends Component {
3435
};
3536

3637
render() {
37-
const { otp, numInputs, separator, isDisabled, hasErrored } = this.state;
38+
const { otp, numInputs, separator, isDisabled, hasErrored, isInputNum } = this.state;
3839

3940
return (
4041
<div className="container">
@@ -93,6 +94,18 @@ class Demo extends Component {
9394
Error
9495
</label>
9596
</div>
97+
<div className="side-bar__segment">
98+
<label htmlFor="isInputNum">
99+
<input
100+
id="isInputNum"
101+
name="isInputNum"
102+
type="checkbox"
103+
checked={isInputNum}
104+
onChange={this.handleCheck}
105+
/>
106+
Input numbers only
107+
</label>
108+
</div>
96109
<div className="side-bar__segment side-bar__segment--bottom">
97110
<a href="https://github.com/ajayns/react-otp-input">
98111
Documentation and Source
@@ -119,6 +132,7 @@ class Demo extends Component {
119132
errorStyle="error"
120133
onChange={this.handleOtpChange}
121134
separator={<span>{separator}</span>}
135+
isInputNum={isInputNum}
122136
shouldAutoFocus
123137
/>
124138
</div>

0 commit comments

Comments
 (0)