fmoo / react-typeahead

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

Clicking an element from the TypeaheadList not firing while showOptionsWhenEmpty #223

Open raduchiriac opened 8 years ago

raduchiriac commented 8 years ago

I am using react-typeahead@2.0.0-alpha.5 with showOptionsWhenEmpty={true}.

<Typeahead
        options={ this.props.availableSites }
        filterOption='name'
        displayOption='name'
        placeholder='Votre site...'
        onOptionSelected={this.onOptionSelected}
        ref='siteBox'
        value={this.state.nameSiteSelected}
        inputProps={{
             style: S.typeahead.typeaheadInput
        }}
        customListComponent={ UI.TypeaheadList }
        showOptionsWhenEmpty={ true }
/>

When I focus my Typeahead, the three elements are displayed but clicking on any of them does not fire the onOptionSelected.

Only if I start typing in and select one of the results would work.

AntiPaste commented 7 years ago

Workaround: change the onClick of the TypeaheadOption to onMouseDown.

sushilnykaa commented 7 years ago

Click on option not triggering the onOptionSelected, its weired its a basic features and its still open?