@react-aria/dnd 3.0.0-nightly.3444 → 3.0.0-nightly.3451

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
@@ -3,8 +3,8 @@ var $4vY0V$reactariautils = require("@react-aria/utils");
3
3
  var $4vY0V$reactariai18n = require("@react-aria/i18n");
4
4
  var $4vY0V$reactarialiveannouncer = require("@react-aria/live-announcer");
5
5
  var $4vY0V$reactariaoverlays = require("@react-aria/overlays");
6
- var $4vY0V$reactariainteractions = require("@react-aria/interactions");
7
6
  var $4vY0V$reactdom = require("react-dom");
7
+ var $4vY0V$reactariainteractions = require("@react-aria/interactions");
8
8
 
9
9
  function $parcel$export(e, n, v, s) {
10
10
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
@@ -25,6 +25,7 @@ $parcel$export(module.exports, "ListDropTargetDelegate", () => $2268795bbb597ecb
25
25
 
26
26
 
27
27
 
28
+
28
29
  let $76b1e110a27b1ccd$export$60b7b4bcf3903d8e;
29
30
  (function($76b1e110a27b1ccd$export$60b7b4bcf3903d8e) {
30
31
  $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["none"] = 0] = "none";
@@ -585,7 +586,18 @@ class $28e10663603f5ea1$var$DragSession {
585
586
  }
586
587
  // Blur and re-focus the drop target so that the focus ring appears.
587
588
  if (this.currentDropTarget) {
588
- this.currentDropTarget.element.blur();
589
+ // Since we cancel all focus events in drag sessions, refire blur to make sure state gets updated so drag target doesn't think it's still focused
590
+ // i.e. When you from one list to another during a drag session, we need the blur to fire on the first list after the drag.
591
+ if (!this.dragTarget.element.contains(this.currentDropTarget.element)) {
592
+ this.dragTarget.element.dispatchEvent(new FocusEvent('blur'));
593
+ this.dragTarget.element.dispatchEvent(new FocusEvent('focusout', {
594
+ bubbles: true
595
+ }));
596
+ }
597
+ // Re-focus the focusedKey upon reorder. This requires a React rerender between blurring and focusing.
598
+ $4vY0V$reactdom.flushSync(()=>{
599
+ this.currentDropTarget.element.blur();
600
+ });
589
601
  this.currentDropTarget.element.focus();
590
602
  }
591
603
  this.setCurrentDropTarget(null);