@tiptap/vue-2 3.20.6 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { VirtualElement, offset, flip, shift, arrow, size, autoPlacement, hide,
2
2
  import { Editor } from '@tiptap/core';
3
3
  import { PluginKey, EditorState } from '@tiptap/pm/state';
4
4
  import { EditorView } from '@tiptap/pm/view';
5
- import { VNode, Component } from 'vue';
5
+ import { Component, VNode } from 'vue';
6
6
 
7
7
  interface BubbleMenuPluginProps {
8
8
  /**
@@ -2,7 +2,7 @@ import { VirtualElement, offset, flip, shift, arrow, size, autoPlacement, hide,
2
2
  import { Editor } from '@tiptap/core';
3
3
  import { PluginKey, EditorState } from '@tiptap/pm/state';
4
4
  import { EditorView } from '@tiptap/pm/view';
5
- import { VNode, Component } from 'vue';
5
+ import { Component, VNode } from 'vue';
6
6
 
7
7
  interface BubbleMenuPluginProps {
8
8
  /**
@@ -1703,8 +1703,8 @@ var BubbleMenuView = class {
1703
1703
  this.hide();
1704
1704
  return;
1705
1705
  }
1706
- this.updatePosition();
1707
1706
  this.show();
1707
+ this.updatePosition();
1708
1708
  };
1709
1709
  /**
1710
1710
  * Handles the transaction event to update the position of the bubble menu.
@@ -1838,6 +1838,9 @@ var BubbleMenuView = class {
1838
1838
  return virtualElement;
1839
1839
  }
1840
1840
  updatePosition() {
1841
+ if (!this.isVisible) {
1842
+ return;
1843
+ }
1841
1844
  const virtualElement = this.virtualElement;
1842
1845
  if (!virtualElement) {
1843
1846
  return;
@@ -1848,6 +1851,9 @@ var BubbleMenuView = class {
1848
1851
  middleware: this.middlewares
1849
1852
  }).then(({ x, y, strategy, middlewareData }) => {
1850
1853
  var _a, _b;
1854
+ if (!this.isVisible || this.editor.isDestroyed || !this.element.isConnected) {
1855
+ return;
1856
+ }
1851
1857
  if (((_a = middlewareData.hide) == null ? void 0 : _a.referenceHidden) || ((_b = middlewareData.hide) == null ? void 0 : _b.escaped)) {
1852
1858
  this.element.style.visibility = "hidden";
1853
1859
  return;