@@ -410,7 +410,7 @@ class DragSession {
410
410
...visibleDropTargets . flatMap ( target => target . activateButtonRef ?. current ? [ target . element , target . activateButtonRef ?. current ] : [ target . element ] )
411
411
] , { shouldUseInert : true } ) ;
412
412
413
- this . mutationObserver . observe ( document . body , { subtree : true , attributes : true , attributeFilter : [ 'aria-hidden' ] } ) ;
413
+ this . mutationObserver . observe ( document . body , { subtree : true , attributes : true , attributeFilter : [ 'aria-hidden' , 'inert' ] } ) ;
414
414
}
415
415
416
416
next ( ) : void {
@@ -437,7 +437,7 @@ class DragSession {
437
437
// If we've reached the end of the valid drop targets, cycle back to the original drag target.
438
438
// This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
439
439
if ( index === this . validDropTargets . length - 1 ) {
440
- if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"]' ) ) {
440
+ if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"], [inert] ' ) ) {
441
441
this . setCurrentDropTarget ( null ) ;
442
442
this . dragTarget . element . focus ( ) ;
443
443
} else {
@@ -472,7 +472,7 @@ class DragSession {
472
472
// If we've reached the start of the valid drop targets, cycle back to the original drag target.
473
473
// This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
474
474
if ( index === 0 ) {
475
- if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"]' ) ) {
475
+ if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"], [inert] ' ) ) {
476
476
this . setCurrentDropTarget ( null ) ;
477
477
this . dragTarget . element . focus ( ) ;
478
478
} else {
@@ -579,7 +579,7 @@ class DragSession {
579
579
cancel ( ) : void {
580
580
this . setCurrentDropTarget ( null ) ;
581
581
this . end ( ) ;
582
- if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"]' ) ) {
582
+ if ( ! this . dragTarget . element . closest ( '[aria-hidden="true"], [inert] ' ) ) {
583
583
this . dragTarget . element . focus ( ) ;
584
584
}
585
585
@@ -640,7 +640,7 @@ class DragSession {
640
640
function findValidDropTargets ( options : DragTarget ) {
641
641
let types = getTypes ( options . items ) ;
642
642
return [ ...dropTargets . values ( ) ] . filter ( target => {
643
- if ( target . element . closest ( '[aria-hidden="true"]' ) ) {
643
+ if ( target . element . closest ( '[aria-hidden="true"], [inert] ' ) ) {
644
644
return false ;
645
645
}
646
646
0 commit comments