reactjs / react-autocomplete

WAI-ARIA compliant React autocomplete (combobox) component
MIT License
2.17k stars 532 forks source link

Immutablejs support #90

Open KevinSagan opened 8 years ago

KevinSagan commented 8 years ago

It seems to be mostly working out of the box, but I ran into one bug--the Enter key down handler pulls the highlighted item out of the list with square brackets: this.getFilteredItems()[this.state.highlightedIndex] Would you be willing to change this to: this.getFilteredItems().get(this.state.highlightedIndex)

ryanflorence commented 8 years ago

then it would only work w/ immutable-js. Perhaps we could have a getItemAtIndex prop to let you inject the behavior.

KevinSagan commented 8 years ago

Oh, js primitive array doesn't have .get(index)? I'm an idiot. Eh, in that case it's not much less work for you than it would be for me to just transform to primitive before I hand it to the autocomplete. Thank you anyway.