@react-aria/dnd 3.0.0-rc.0 → 3.0.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.
package/dist/main.js CHANGED
@@ -89,7 +89,7 @@ function $4620ae0dc40f0031$export$e1d41611756c6326(items) {
89
89
  function $4620ae0dc40f0031$var$mapModality(modality) {
90
90
  if (!modality) modality = 'virtual';
91
91
  if (modality === 'pointer') modality = 'virtual';
92
- if (modality === 'virtual' && 'ontouchstart' in window) modality = 'touch';
92
+ if (modality === 'virtual' && typeof window !== 'undefined' && 'ontouchstart' in window) modality = 'touch';
93
93
  return modality;
94
94
  }
95
95
  function $4620ae0dc40f0031$export$49bac5d6d4b352ea() {
@@ -198,7 +198,9 @@ function $4620ae0dc40f0031$export$d9e760437831f8b3(dataTransfer) {
198
198
  // only implemented in Chrome.
199
199
  if (typeof item.webkitGetAsEntry === 'function') {
200
200
  let entry = item.webkitGetAsEntry();
201
+ // eslint-disable-next-line max-depth
201
202
  if (!entry) continue;
203
+ // eslint-disable-next-line max-depth
202
204
  if (entry.isFile) items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
203
205
  else if (entry.isDirectory) items.push($4620ae0dc40f0031$var$createDirectoryItem(entry));
204
206
  } else // Assume it's a file.
@@ -3031,6 +3033,7 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
3031
3033
  }
3032
3034
  };
3033
3035
  let onDragEnter = (e)=>{
3036
+ e.preventDefault();
3034
3037
  e.stopPropagation();
3035
3038
  state.dragOverElements.add(e.target);
3036
3039
  if (state.dragOverElements.size > 1) return;
@@ -3054,6 +3057,7 @@ function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
3054
3057
  if (dropOperation !== 'cancel') fireDropEnter(e);
3055
3058
  };
3056
3059
  let onDragLeave = (e)=>{
3060
+ e.preventDefault();
3057
3061
  e.stopPropagation();
3058
3062
  // We would use e.relatedTarget to detect if the drag is still inside the drop target,
3059
3063
  // but it is always null in WebKit. https://bugs.webkit.org/show_bug.cgi?id=66547