@tiptap/vue-2 3.4.0 → 3.4.2
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.
package/dist/menus/index.cjs
CHANGED
|
@@ -1639,6 +1639,7 @@ var BubbleMenuView = class {
|
|
|
1639
1639
|
}) {
|
|
1640
1640
|
this.preventHide = false;
|
|
1641
1641
|
this.isVisible = false;
|
|
1642
|
+
this.scrollTarget = window;
|
|
1642
1643
|
this.floatingUIOptions = {
|
|
1643
1644
|
strategy: "absolute",
|
|
1644
1645
|
placement: "top",
|
|
@@ -1684,12 +1685,12 @@ var BubbleMenuView = class {
|
|
|
1684
1685
|
setTimeout(() => this.update(this.editor.view));
|
|
1685
1686
|
};
|
|
1686
1687
|
this.blurHandler = ({ event }) => {
|
|
1687
|
-
var
|
|
1688
|
+
var _a2;
|
|
1688
1689
|
if (this.preventHide) {
|
|
1689
1690
|
this.preventHide = false;
|
|
1690
1691
|
return;
|
|
1691
1692
|
}
|
|
1692
|
-
if ((event == null ? void 0 : event.relatedTarget) && ((
|
|
1693
|
+
if ((event == null ? void 0 : event.relatedTarget) && ((_a2 = this.element.parentNode) == null ? void 0 : _a2.contains(event.relatedTarget))) {
|
|
1693
1694
|
return;
|
|
1694
1695
|
}
|
|
1695
1696
|
if ((event == null ? void 0 : event.relatedTarget) === this.editor.view.dom) {
|
|
@@ -1724,12 +1725,14 @@ var BubbleMenuView = class {
|
|
|
1724
1725
|
this.updatePosition();
|
|
1725
1726
|
this.show();
|
|
1726
1727
|
};
|
|
1728
|
+
var _a;
|
|
1727
1729
|
this.editor = editor;
|
|
1728
1730
|
this.element = element;
|
|
1729
1731
|
this.view = view;
|
|
1730
1732
|
this.updateDelay = updateDelay;
|
|
1731
1733
|
this.resizeDelay = resizeDelay;
|
|
1732
1734
|
this.appendTo = appendTo;
|
|
1735
|
+
this.scrollTarget = (_a = options == null ? void 0 : options.scrollTarget) != null ? _a : window;
|
|
1733
1736
|
this.floatingUIOptions = {
|
|
1734
1737
|
...this.floatingUIOptions,
|
|
1735
1738
|
...options
|
|
@@ -1743,6 +1746,7 @@ var BubbleMenuView = class {
|
|
|
1743
1746
|
this.editor.on("focus", this.focusHandler);
|
|
1744
1747
|
this.editor.on("blur", this.blurHandler);
|
|
1745
1748
|
window.addEventListener("resize", this.resizeHandler);
|
|
1749
|
+
this.scrollTarget.addEventListener("scroll", this.resizeHandler);
|
|
1746
1750
|
this.update(view, view.state);
|
|
1747
1751
|
if (this.getShouldShow()) {
|
|
1748
1752
|
this.show();
|
|
@@ -1897,6 +1901,7 @@ var BubbleMenuView = class {
|
|
|
1897
1901
|
this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: true });
|
|
1898
1902
|
this.view.dom.removeEventListener("dragstart", this.dragstartHandler);
|
|
1899
1903
|
window.removeEventListener("resize", this.resizeHandler);
|
|
1904
|
+
this.scrollTarget.removeEventListener("scroll", this.resizeHandler);
|
|
1900
1905
|
this.editor.off("focus", this.focusHandler);
|
|
1901
1906
|
this.editor.off("blur", this.blurHandler);
|
|
1902
1907
|
if (this.floatingUIOptions.onDestroy) {
|