Skip to content

Commit 2a0ae66

Browse files
authored
fix: DragPreview is not visible in safari (#9200)
* fix: DragPreview is not visible in safari * fix mock * fix more mocks
1 parent 5bfb320 commit 2a0ae66

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/@react-aria/dnd/src/DragPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ React.forwardRef(function DragPreview(props: DragPreviewProps, ref: ForwardedRef
7474
}
7575

7676
return (
77-
<div style={{zIndex: -100, position: 'absolute', top: 0, left: -100000}} ref={domRef}>
77+
<div style={{zIndex: -100, position: 'fixed', top: 0, left: -100000}} ref={domRef}>
7878
{children}
7979
</div>
8080
);

packages/@react-aria/dnd/test/dnd.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,8 +1337,8 @@ describe('useDrag and useDrop', function () {
13371337
top: 0,
13381338
x: 0,
13391339
y: 0,
1340-
width: this.style.position === 'absolute' ? 20 : 100,
1341-
height: this.style.position === 'absolute' ? 20 : 50
1340+
width: this.style.position === 'fixed' ? 20 : 100,
1341+
height: this.style.position === 'fixed' ? 20 : 50
13421342
};
13431343
});
13441344

@@ -1364,8 +1364,8 @@ describe('useDrag and useDrop', function () {
13641364
top: 0,
13651365
x: 0,
13661366
y: 0,
1367-
width: this.style.position === 'absolute' ? 20 : 100,
1368-
height: this.style.position === 'absolute' ? 20 : 50
1367+
width: this.style.position === 'fixed' ? 20 : 100,
1368+
height: this.style.position === 'fixed' ? 20 : 50
13691369
};
13701370
});
13711371

@@ -1391,8 +1391,8 @@ describe('useDrag and useDrop', function () {
13911391
top: 0,
13921392
x: 0,
13931393
y: 0,
1394-
width: this.style.position === 'absolute' ? 20 : 100,
1395-
height: this.style.position === 'absolute' ? 20 : 50
1394+
width: this.style.position === 'fixed' ? 20 : 100,
1395+
height: this.style.position === 'fixed' ? 20 : 50
13961396
};
13971397
});
13981398

0 commit comments

Comments
 (0)