Skip to content

Commit 5d62fed

Browse files
committed
Demo: update for external state setting
1 parent bcc75d9 commit 5d62fed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

demo/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ <h1><code>&lt;<a href="https://github.com/insin/react-maskedinput">MaskedInput</
9292
<p className="lead">A React component which creates a masked <code>&lt;input/&gt;</code></p>
9393
<div className="form-field">
9494
<label htmlFor="card">Card Number:</label>
95-
<MaskedInput mask="1111 1111 1111 1111" name="card" id="card" size="20" onChange={this._onChange}/>
95+
<MaskedInput mask="1111 1111 1111 1111" name="card" id="card" size="20" value={this.state.card} onChange={this._onChange}/>
96+
</div>
97+
<p>You can even externally update the card state like a standard input element:</p>
98+
<div className="form-field">
99+
<label htmlFor="card">Externally Update:</label>
100+
<input onChange={this._onChange} name="card" maxLength="16" style={{borderBottom: '1px solid #999'}} />
96101
</div>
97102
<p>Placeholders are automatically generated but can be overridden with your own:</p>
98103
<div className="form-field">

0 commit comments

Comments
 (0)