Closed dave-irvine closed 6 years ago
@dave-irvine Thanks for submitting the issue. Will take a look soon
Hi there
We faced the same issue when data values were integers. The issue seems to be ficed for us by modifying the like that reads:
Return this._getTypeSafeOptionValue(optionValue)
To:
Return this._getTypeSafeOptionValue(optionValue).toString()
I can raise a pull request if you wish?
@jayjaybeeuk thanks. This is on my todo list but it may be a couple days. If you want to make a PR that would be great too
@dave-irvine @jayjaybeeuk https://github.com/alsoscotland/react-super-select/tree/v1.0.16 should hopefully fix this for you. Sorry it took a little longer than my usual response. I have been pretty slammed.
Example: https://codesandbox.io/s/mq4ry6m969
Open the dropdown menu and press spacebar.
Essentially the problem boils down to https://github.com/alsoscotland/react-super-select/blob/master/src/react-super-select.js#L896 which converts from strings to Number. Unfortunately when this Number later gets consumed in https://github.com/alsoscotland/react-super-select/blob/master/src/react-super-select.js#L557 it is part of a type-sensitive comparison and therefore fails to pass the test.