I'm trying to get onPaste working with react-select. It seems like, that it is not possible to make use of the event.
Basically I'm just doing this within the <Select/>: onPaste={(e) => this.doPasteMagic(e)}
But it is never fired. Am I missing something or is there another way to distinguish between typing and pasting?
I've seen a few suggestions about using onChange, but this seems dirty to me as well.
I was fiddling a lot with that. I find it rather surprising that this is not one of the main features of react-select. Anyway, I've found a workaround for this:
<div style={{height: '100%', width: '100%' }} onPaste={(e) => console.log(e)}>
<Select .../>
</div>
This seems to do the trick and triggers the right event at the right time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With