jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.38k stars 1.15k forks source link

Editor onBlur getting called when sibling button clicked #1355

Open ChenCodes opened 1 year ago

ChenCodes commented 1 year ago

Hi there, not sure if this is a bug in the package, but I'm noticing that the editor doesn't allow sibling click events to go through on the first click when the editor is focused.

Here's my setup:

<>
   <Editor onBlur={() => console.log('blurred')} />
   <Button onClick={() => console.log('button clicked')} />
<>

When the Editor is focused, and I click on the Button, the first time that I click on the button, the log that gets printed is blurred and only on the second time that I click on the button is button clicked printed.

Based on the other text field components that I've seen, it looks like they allow external button clicks to be triggered along with the editor blur event.

Any help would be greatly appreciated!