fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 231 forks source link

Fix cWRP to look at new values #163

Closed nosilleg closed 8 years ago

nosilleg commented 8 years ago

This change prevents visible from being populated on render after entryText has been cleared.

Fixes #162

fmoo commented 8 years ago

Just to confirm, you re-ran the test suite and everything still passes?

Also, is there a quick test case you can add to confirm the behavior?

nosilleg commented 8 years ago

All 69 tests are passing.

Every case is a test case as long as you can press tab twice faster than the component re-renders... :smile:

Seriously though, I don't have a test case ready. Hopefully the "stack trace" in the issue explains the situation. It's only possible to get two tokens generated from this because the next render will pass the "old" entryText value of "", which is the same as the expected value at that point.

The basic premise of the change is that the available options should be based solely on the upcoming state, not a mixture of the current and next state.

fmoo commented 8 years ago

Merged, tagged, and 1.1.6 pushed to npm