-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Required input attr #80
Comments
I suppose there should be a required attribute attached to the input, right? |
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 |
Ah, okay, will add. |
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}
/> |
I wouldn’t put all the props on the element. I think a whitelist with supported attributes it the better way. |
You can create other prop like
|
@ro-ka Are you already working on this? I also need this feature. I can do a pull request for you. |
@ro-ka What do you think about including other attributes like 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. |
Will add, yes. No time till now. :) |
Released as |
Awesome! 👍 |
@ro-ka I think it's missing the That's the case:
|
Totally, will fix that! |
Fixed in |
When I put
required
nothing happensThe text was updated successfully, but these errors were encountered: