@tiptap/core 2.0.0-beta.216 → 2.0.0-beta.218

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/index.cjs CHANGED
@@ -3970,10 +3970,11 @@ class NodeView {
3970
3970
  if (!isInElement) {
3971
3971
  return false;
3972
3972
  }
3973
+ const isDragEvent = event.type.startsWith('drag');
3973
3974
  const isDropEvent = event.type === 'drop';
3974
3975
  const isInput = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'].includes(target.tagName) || target.isContentEditable;
3975
3976
  // any input event within node views should be ignored by ProseMirror
3976
- if (isInput && !isDropEvent) {
3977
+ if (isInput && !isDropEvent && !isDragEvent) {
3977
3978
  return true;
3978
3979
  }
3979
3980
  const { isEditable } = this.editor;
@@ -3984,7 +3985,6 @@ class NodeView {
3984
3985
  const isPasteEvent = event.type === 'paste';
3985
3986
  const isCutEvent = event.type === 'cut';
3986
3987
  const isClickEvent = event.type === 'mousedown';
3987
- const isDragEvent = event.type.startsWith('drag');
3988
3988
  // ProseMirror tries to drag selectable nodes
3989
3989
  // even if `draggable` is set to `false`
3990
3990
  // this fix prevents that
@@ -4004,6 +4004,9 @@ class NodeView {
4004
4004
  document.addEventListener('dragend', () => {
4005
4005
  this.isDragging = false;
4006
4006
  }, { once: true });
4007
+ document.addEventListener('drop', () => {
4008
+ this.isDragging = false;
4009
+ }, { once: true });
4007
4010
  document.addEventListener('mouseup', () => {
4008
4011
  this.isDragging = false;
4009
4012
  }, { once: true });