BlockNote
BlockNote copied to clipboard
Adding onBlur breaks SideMenu customization
Describe the bug If you implement this example in the docs (https://www.blocknotejs.org/docs/side-menu#custom-side-menu) to customize the side menu it works, until you add an onBlur event to the editor:
To Reproduce
Just implement the above example, add and remove the onBlur event handler.
Misc
- Node version: 20.10
- Package manager: npm
- Browser: Chrome
- [ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖
Hi I'm not running into any issues with this on 0.14.0, but you can try using this to add a blur listener to the editor instead:
useEffect(() => {
const cb = () => {
console.log('blur');
};
editor._tiptapEditor.on('blur', cb);
return () => {
editor._tiptapEditor.off('blur', cb);
};
}, []);
I would suggest updating to 0.14.0 though if you haven't already, as it seems to be fixed.