@tiptap/core 2.0.0-beta.217 → 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.js CHANGED
@@ -3966,10 +3966,11 @@ class NodeView {
3966
3966
  if (!isInElement) {
3967
3967
  return false;
3968
3968
  }
3969
+ const isDragEvent = event.type.startsWith('drag');
3969
3970
  const isDropEvent = event.type === 'drop';
3970
3971
  const isInput = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'].includes(target.tagName) || target.isContentEditable;
3971
3972
  // any input event within node views should be ignored by ProseMirror
3972
- if (isInput && !isDropEvent) {
3973
+ if (isInput && !isDropEvent && !isDragEvent) {
3973
3974
  return true;
3974
3975
  }
3975
3976
  const { isEditable } = this.editor;
@@ -3980,7 +3981,6 @@ class NodeView {
3980
3981
  const isPasteEvent = event.type === 'paste';
3981
3982
  const isCutEvent = event.type === 'cut';
3982
3983
  const isClickEvent = event.type === 'mousedown';
3983
- const isDragEvent = event.type.startsWith('drag');
3984
3984
  // ProseMirror tries to drag selectable nodes
3985
3985
  // even if `draggable` is set to `false`
3986
3986
  // this fix prevents that
@@ -4000,6 +4000,9 @@ class NodeView {
4000
4000
  document.addEventListener('dragend', () => {
4001
4001
  this.isDragging = false;
4002
4002
  }, { once: true });
4003
+ document.addEventListener('drop', () => {
4004
+ this.isDragging = false;
4005
+ }, { once: true });
4003
4006
  document.addEventListener('mouseup', () => {
4004
4007
  this.isDragging = false;
4005
4008
  }, { once: true });