Skip to content

Build your personal knowledge base with Trilium Notes

1.5 KB
Raw Blame
diff --git a/dist/index.cjs.js b/dist/index.cjs.js
index e4db255..636da4e 100644
--- a/dist/index.cjs.js
+++ b/dist/index.cjs.js
@@ -1469,7 +1469,11 @@ var isEditableTarget = function (node) {
         return true;
     if (element.isContentEditable)
         return true;
-    return element.closest(CONTENT_EDITABLE_SELECTOR) !== null;
+    // A `contenteditable="false"` island, such as the widget of an editor, is not editable
+    // even inside an editable region.
+    var host = element.closest(CONTENT_EDITABLE_SELECTOR);
+    var island = element.closest('[contenteditable="false"]');
+    return host !== null && (island === null || island.contains(host));
 };
 /**
  * HTML5 drag sources (or anything nested inside them). A pan started here
diff --git a/dist/index.esm.js b/dist/index.esm.js
index 92c7948..597439a 100644
--- a/dist/index.esm.js
+++ b/dist/index.esm.js
@@ -1467,7 +1467,11 @@ var isEditableTarget = function (node) {
         return true;
     if (element.isContentEditable)
         return true;
-    return element.closest(CONTENT_EDITABLE_SELECTOR) !== null;
+    // A `contenteditable="false"` island, such as the widget of an editor, is not editable
+    // even inside an editable region.
+    var host = element.closest(CONTENT_EDITABLE_SELECTOR);
+    var island = element.closest('[contenteditable="false"]');
+    return host !== null && (island === null || island.contains(host));
 };
 /**
  * HTML5 drag sources (or anything nested inside them). A pan started here