missive / emoji-mart

🏪 One component to pick them all
https://missiveapp.com/open/emoji-mart
MIT License
8.67k stars 835 forks source link

if onSelect is not set and onClick is, the script breaks. #189

Closed kafeltz closed 6 years ago

kafeltz commented 6 years ago

The error will be thrown when you open the emoji and then select one of them.

My example:

<Picker
    native={true}
    showPreview={false}
    i18n={categories}
    exclude={['search', 'recent', 'nature', 'foods', 'activity', 'places', 'objects', 'symbols', 'flags', 'custom']}
    color={'#2f3540'}
    emojiTooltip={true}
    emojisToShowFilter={emojisToShowFilter}
    onClick={this.handleClickEmoji}
    style={{ position: 'absolute', bottom: '55px', right: '33px', width: this.state.width }}
/>

It breaks in this file/line: https://github.com/missive/emoji-mart/blob/master/src/components/picker/nimble-picker.js#L240

To workaround this, I must set both properties:

onClick={this.handleClickEmoji}
onSelect={this.handleClickEmoji}

image

EtienneLem commented 6 years ago

It’s been fixed by #183, I shall do a quick release right away.

EtienneLem commented 6 years ago

v2.6.1 has been released, thanks for the reminder!

kafeltz commented 6 years ago

Thx, I need it right now.