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 {
157157 private restoreAriaHidden : ( ) => void ;
158158 private formatMessage : ( key : string ) => string ;
159159 private isVirtualClick : boolean ;
160+ private initialFocused : boolean ;
160161
161162 constructor ( target : DragTarget , formatMessage : ( key : string ) => string ) {
162163 this . dragTarget = target ;
@@ -168,6 +169,7 @@ class DragSession {
168169 this . onClick = this . onClick . bind ( this ) ;
169170 this . onPointerDown = this . onPointerDown . bind ( this ) ;
170171 this . cancelEvent = this . cancelEvent . bind ( this ) ;
172+ this . initialFocused = false ;
171173 }
172174
173175 setup ( ) {
@@ -446,6 +448,13 @@ class DragSession {
446448
447449 item ?. element . focus ( ) ;
448450 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+ }
449458 }
450459 }
451460
You can’t perform that action at this time.
0 commit comments