Comments (14)
I suppose there should be a required attribute attached to the input, right?
from react-geosuggest.
Yes, the result code would be:
<div class="geosuggest ">
<input class="geosuggest__input " type="text" value="" placeholder="Start location" required>
<ul class="geosuggest__suggests geosuggest__suggests--hidden"></ul>
</div>
You can use spread operator, something like <input {...this.props} />
from react-geosuggest.
Ah, okay, will add.
from react-geosuggest.
Something like:
<input
className={'geosuggest__input ' + this.props.inputClassName}
ref="geosuggestInput"
type="text"
value={this.state.userInput}
placeholder={this.props.placeholder}
disabled={this.props.disabled}
onKeyDown={this.onInputKeyDown}
onChange={this.onInputChange}
onFocus={this.onFocus}
onBlur={this.hideSuggests}
{...this.props}
/>
from react-geosuggest.
I wouldn’t put all the props on the element. I think a whitelist with supported attributes it the better way.
from react-geosuggest.
You can create other prop like isRequired={true}
, for example.
<Geosuggest isRequired />
from react-geosuggest.
@ro-ka Are you already working on this? I also need this feature. I can do a pull request for you.
from react-geosuggest.
@ro-ka What do you think about including other attributes like autocomplete
, name
, id
, etc...
The solution proposed by @CezarLuiz0 seems to solve this problem, in my opinion the component should not know all the properties assigned to the input element.
from react-geosuggest.
Will add, yes. No time till now. :)
That’s true, but it’ll attach a lot of non standard attributes to the input element. Will a whitelist with attributes that are defined in the spec to add.
from react-geosuggest.
Released as 1.15.0
. Thanks for bringing this up!
from react-geosuggest.
Awesome! 👍
from react-geosuggest.
@ro-ka I think it's missing the id
attribute.
That's the case:
<label for="place">Search Places</label>
from react-geosuggest.
Totally, will fix that!
from react-geosuggest.
Fixed in 1.15.1
. Thanks! :)
from react-geosuggest.
Related Issues (20)
- Billing issues HOT 3
- Expose TypeScript type definitions
- Warning: Prop `aria-owns` did not match. HOT 1
- selectSuggest doesn't trigger onSelectSuggests HOT 3
- Inconsitent suggest.gmaps property received in onSuggestSelect HOT 2
- Test `react-geosuggest` with puppeteer HOT 1
- utc_offset is deprecated as of November 2019 and will beturned off in November 2020. Use utc_offset_minutes instead. HOT 3
- How to allow current location ? and get address based on current location coordinates ? HOT 1
- ul role=listbox should define an aria-label or aria-labelledby HOT 2
- Support React 17 HOT 2
- Selected suggestion didn't apply properly, when searching in Argentina region HOT 1
- Type is invalid - expected a string or a class/function (for composite components) but got: undefined. Check the render method of `Input`. HOT 7
- Google maps API was not found in the page. HOT 2
- Handle the errors returned by the geocoder API
- Label "for" and input "id" do not match
- 'Avnei Hefetz' is an israli settlement city which is not coming in country 'IL' suggestions whereas 'Einav' is also an israli settlement city which is coming in country 'IL' suggestions. HOT 1
- How to detach geocomplete event?
- Using bounds not filtering suggests HOT 1
- Bounds, location, and radius are deprecated
- Support and document loading Maps API via Bootstrap Loader
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-geosuggest.