File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/@react-aria/dnd/src Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -237,17 +237,19 @@ export function useDrag(options: DragOptions): DragResult {
237237
238238 interactions = {
239239 ...descriptionProps ,
240- onPointerDown ( { nativeEvent : e } ) {
240+ onPointerDown ( e ) {
241241 // Try to detect virtual drags.
242242 if ( e . width < 1 && e . height < 1 ) {
243243 // iOS VoiceOver.
244244 modalityOnPointerDown . current = 'virtual' ;
245245 } else {
246- let rect = ( e . target as HTMLElement ) . getBoundingClientRect ( ) ;
246+ let rect = e . currentTarget . getBoundingClientRect ( ) ;
247+ let offsetX = e . clientX - rect . x ;
248+ let offsetY = e . clientY - rect . y ;
247249 let centerX = rect . width / 2 ;
248250 let centerY = rect . height / 2 ;
249251
250- if ( Math . abs ( e . offsetX - centerX ) < 0.5 && Math . abs ( e . offsetY - centerY ) < 0.5 ) {
252+ if ( Math . abs ( offsetX - centerX ) < 0.5 && Math . abs ( offsetY - centerY ) < 0.5 ) {
251253 // Android TalkBack.
252254 modalityOnPointerDown . current = 'virtual' ;
253255 } else {
You can’t perform that action at this time.
0 commit comments