File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/@react-aria/dnd/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ class DragSession {
157
157
private restoreAriaHidden : ( ) => void ;
158
158
private formatMessage : ( key : string ) => string ;
159
159
private isVirtualClick : boolean ;
160
+ private initialFocused : boolean ;
160
161
161
162
constructor ( target : DragTarget , formatMessage : ( key : string ) => string ) {
162
163
this . dragTarget = target ;
@@ -168,6 +169,7 @@ class DragSession {
168
169
this . onClick = this . onClick . bind ( this ) ;
169
170
this . onPointerDown = this . onPointerDown . bind ( this ) ;
170
171
this . cancelEvent = this . cancelEvent . bind ( this ) ;
172
+ this . initialFocused = false ;
171
173
}
172
174
173
175
setup ( ) {
@@ -446,6 +448,13 @@ class DragSession {
446
448
447
449
item ?. element . focus ( ) ;
448
450
this . currentDropItem = item ;
451
+
452
+ // Annouce first drop target after drag start announcement finishes.
453
+ // Otherwise, it will never get announced because drag start announcement is assertive.
454
+ if ( ! this . initialFocused ) {
455
+ announce ( item ?. element . getAttribute ( 'aria-label' ) , 'polite' ) ;
456
+ this . initialFocused = true ;
457
+ }
449
458
}
450
459
}
451
460
You can’t perform that action at this time.
0 commit comments