Files
tiptap/packages
Tomas Valenta e9465ec0f6 fix: Add editor dependency when registering BubbleMenuPlugin and FloatingMenuPlugin (#2018)
* Add `editor` dependency when registering `BubbleMenuPlugin`

When we are initializing editor via the `useEditor` hook with dependencies the `BubbleMenu` component is only registered the first time the editor is initialized.

Adding editor to the dependency array registering/unregistering the `BubbleMenuPlugin` fixes this. (I tested exactly this code in our project.)

I also added a check that ensures that the menu element referenced via the `useRef` is defined when registering the plugin - otherwise, there is no point in registering the plugin.

* Add `editor` dependency when registering `FloatingMenuPlugin`
2021-10-12 11:09:00 +02:00
..
2021-10-10 22:24:18 +02:00
2021-10-10 21:35:11 +02:00
2021-10-10 21:35:11 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-07-26 11:42:13 +02:00
2021-10-10 21:35:11 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-09-08 23:56:15 +02:00
2021-07-26 11:42:13 +02:00
2021-08-26 14:12:10 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-09-08 23:56:15 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-10-10 21:35:11 +02:00
2021-08-20 21:15:31 +02:00
2021-10-08 15:08:08 +02:00
2021-10-11 20:50:55 +02:00
2021-10-10 21:35:11 +02:00
2021-10-08 15:08:08 +02:00
2021-07-26 11:42:13 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-08-11 14:40:00 +02:00
2021-10-08 15:08:08 +02:00
2021-10-10 21:35:11 +02:00
2021-07-26 11:42:13 +02:00
2021-07-26 11:42:13 +02:00
2021-10-08 15:08:08 +02:00
2021-09-08 23:56:15 +02:00
2021-09-08 23:56:15 +02:00
2021-07-26 11:42:13 +02:00
2021-10-08 15:08:08 +02:00
2021-07-26 11:42:13 +02:00
2021-07-26 11:42:13 +02:00
2021-09-08 23:56:15 +02:00
2021-07-26 11:42:13 +02:00
2021-10-08 15:08:08 +02:00
2021-07-26 11:42:13 +02:00
2021-10-10 22:24:18 +02:00
2021-10-10 22:24:18 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00
2021-10-08 15:08:08 +02:00