Comments (1)
Hey @romanbr87, thanks for the feature request. The short answer here is that it's not really feasible to have default HTML behavior for a required form element and that you should probably be validating manually.
The form element is an input, so it can't track selections. For the single-selection case, you could pass a required
value to inputProps
, which will be applied to the input. However, this won't distinguish between arbitrary text from a user and a true "selection". For the multi-selection case, the input element is cleared as selections are made, so that approach won't work.
My recommendation is to track the selection state and validate the typeahead manually upon form submission.
from react-bootstrap-typeahead.
Related Issues (20)
- Using Typeahead as Ref / createRef<Typeahead<any>>() / TS 5.2 / react 18.2.0 HOT 1
- Allow component in `labelKey` HOT 1
- Disabled options can be selected by pressing Tab key HOT 2
- Feature Request - Sorting Options Based on Search Query
- Max tokens prop when multiple
- When multiple is set to true to have the possibility of having the menu open when clicking on an option and close on click outside
- Can't access custom MenuItem html HOT 4
- Clear button has small duplicate x (extra span) HOT 1
- When adding this Typeahead component my react application won't load anymore HOT 1
- MenuItem component only displays a subset of suggestions HOT 3
- Typescript types incompatible on examplecode
- Accessible id is not being applied correctly, cannot access element via label text HOT 3
- Copy pasting any value with spaces should remove spaces. HOT 1
- Please delete this issue
- AsyncTypeahead renders old options before new options
- clearButton not shown with defaultInputValue HOT 1
- found an UI glitch HOT 1
- app.component.html HOT 1
- Let the value of the input be controlled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-bootstrap-typeahead.