Skip to content
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

Option search is being run one change behind #128

Open
Mr-Wallet opened this issue Sep 9, 2015 · 5 comments · May be fixed by #146
Open

Option search is being run one change behind #128

Mr-Wallet opened this issue Sep 9, 2015 · 5 comments · May be fixed by #146
Labels

Comments

@Mr-Wallet
Copy link

When constructing a Typeahead with an array of strings as the object, each change brings up a list of options reflecting the input node's value before the change.

'' > no list
'a' > empty list
'ab' > list matching 'a'
'abc' > list matching 'ab'
'ab' [backspace] > list matching 'abc'
'abPASTED_TEXT' > list matching 'ab'
'abPASTED_TEXTc' > list matching 'abPASTED_TEXT'

Based on stepping through, it seems to be because componentWillReceiveProps is using this.state.entryValue to calculate the options, but the setState({entryValue}) in _onTextEntryUpdated hasn't yet been put into this.state at that point. As a result, even though the correct options are calculated in _onTextEntryUpdated, they're instantly overridden before the render occurs by a recalculation in componentWillReceiveProps using the previous state.

@mattvv
Copy link

mattvv commented Sep 30, 2015

Also having this issue.

@mattvv
Copy link

mattvv commented Sep 30, 2015

This seems to work fine on tokenizer though.

@smith-kyle
Copy link

I'm experiencing this as well

@juanmnl
Copy link

juanmnl commented Oct 20, 2015

I was experiencing this until i removed defaultValue="" from the component props.

@alexjg
Copy link

alexjg commented Dec 9, 2015

@fmoo Is there any chance you could take a look at the above PR which fixes this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants