alsoscotland / react-super-select

MIT License
95 stars 33 forks source link

Onchange event not working on keyboard selection. #149

Closed dineshgm closed 6 years ago

dineshgm commented 6 years ago

Hi,

I am able to use onChange event when I use the mouse click, But whenever I tend to use keyboard(Enter key) to select the option, I see following error on my console.

react-super-select.js:1 Uncaught TypeError: Cannot read property 'name' of undefined
    at eval (react-super-select.js:1)
    at arrayMap (ReactDOM.js:16)
    at map (map.js:50)
    at ReactSuperSelect._getNormalDisplayMarkup (react-super-select.js:1)
    at ReactSuperSelect.wrapper [as _getNormalDisplayMarkup] (_createBind.js:23)
    at ReactSuperSelect._generateValueDisplay (react-super-select.js:1)
    at ReactSuperSelect.wrapper [as _generateValueDisplay] (_createBind.js:23)
    at ReactSuperSelect.render (react-super-select.js:1)
    at eval (ReactCompositeComponent.js:796)
    at measureLifeCyclePerf (ReactCompositeComponent.js:75)
    at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:795)
    at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js:822)
    at ReactCompositeComponentWrapper._updateRenderedComponent (ReactCompositeComponent.js:746)
    at ReactCompositeComponentWrapper._performComponentUpdate (ReactCompositeComponent.js:724)
    at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:645)
    at ReactCompositeComponentWrapper.performUpdateIfNecessary (ReactCompositeComponent.js:561)
    at Object.performUpdateIfNecessary (ReactReconciler.js:157)
    at runBatchedUpdates (ReactUpdates.js:150)
    at ReactReconcileTransaction.perform (Transaction.js:140)
    at ReactUpdatesFlushTransaction.perform (Transaction.js:140)
    at ReactUpdatesFlushTransaction.perform (ReactUpdates.js:89)
    at Object.flushBatchedUpdates (ReactUpdates.js:172)
    at ReactDefaultBatchingStrategyTransaction.closeAll (Transaction.js:206)
    at ReactDefaultBatchingStrategyTransaction.perform (Transaction.js:153)
    at Object.batchedUpdates (ReactDefaultBatchingStrategy.js:62)
    at Object.batchedUpdates (ReactUpdates.js:97)
    at dispatchEvent (ReactEventListener.js:147)
alsoscotland commented 6 years ago

@dineshgm can you give me more info about your setup? I cannot reproduce the scenario where enter key on an option yields an undefined option. Are you passing undefined in your dataSource by chance?

alsoscotland commented 6 years ago

@dineshgm closing since I have not heard a response