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 {
237
237
238
238
interactions = {
239
239
...descriptionProps ,
240
- onPointerDown ( { nativeEvent : e } ) {
240
+ onPointerDown ( e ) {
241
241
// Try to detect virtual drags.
242
242
if ( e . width < 1 && e . height < 1 ) {
243
243
// iOS VoiceOver.
244
244
modalityOnPointerDown . current = 'virtual' ;
245
245
} 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 ;
247
249
let centerX = rect . width / 2 ;
248
250
let centerY = rect . height / 2 ;
249
251
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 ) {
251
253
// Android TalkBack.
252
254
modalityOnPointerDown . current = 'virtual' ;
253
255
} else {
You can’t perform that action at this time.
0 commit comments