Using the react-bootstrap-typeahead
<Typeahead
{...this.state}
id="basic-example"
onChange={id => this.setState({ id })}
options={id}
placeholder="Select ID"
/>
is to possible to restrict the input of Typeahead to only numbers? if yes, provide an overview how to do it
Yes you can set the inputProps
:
<Typeahead
{...this.state}
id="basic-example"
inputProps={{
type: 'number',
}}
onChange={id => this.setState({ id })}
options={id}
placeholder="Select ID"
/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.