-
Notifications
You must be signed in to change notification settings - Fork 229
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
defaultValue not selecting the value, dropdown box remains open #151
Comments
actually, i'm seeing the drop-down remain open even if I have a single match. Not sure if this is by design, but I would prefer, or at least have the option, to have the default value pre-selected. |
@fmoo not sure if it's the best approach, but I have something working where I check if // added:
_renderIncrementalSearchResults: function() {
// A default value was passed in
if (this.props.defaultValue && !this.state.hasRendered) {
return "";
} _onTextEntryUpdated: function() {
var value = this.refs.entry.getDOMNode().value;
this.setState({visible: this.getOptionsForValue(value, this.props.options),
selection: null,
selectionIndex: 0,
hasRendered: true, // <-- added
entryValue: value});
} |
+1 for this. @benrlodge is there any way without modifying the source code? :( |
'fraid not from what I can tell. I'm working off a forked version in the mean time. |
my bad. didnt see |
@benrlodge I'm coming to this from #176 What's the use case here? Is this something that Tokenizer defaultSelected doesn't solve? Are you only using Typeahead and not Tokenizer? |
When I use
defaultValue
if there is a fuzzy match, it does not select the matching value, but instead shows the matching options (as if you typed in the value). I may be able to look into submitting a PR if this isn't already being worked on.The text was updated successfully, but these errors were encountered: