fix(reply modal): dragging modal could select text behind it

This commit is contained in:
Tom (plebeius.eth)
2025-03-03 22:27:39 +01:00
parent 2a1c95a447
commit 2d1fb69f02
+9 -1
View File
@@ -151,7 +151,15 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s
}));
const bind = useDrag(
({ offset: [ox, oy] }) => {
({ active, event, offset: [ox, oy] }) => {
if (active) {
event.preventDefault();
document.body.style.userSelect = 'none';
document.body.style.webkitUserSelect = 'none';
} else {
document.body.style.userSelect = '';
document.body.style.webkitUserSelect = '';
}
api.start({ x: ox, y: oy, immediate: true });
},
{