tangled
alpha
login
or
join now
retr0.id
/
pdsls
forked from
pds.ls/pdsls
1
fork
atom
atproto explorer
1
fork
atom
overview
issues
pulls
pipelines
fix drag
handle.invalid
4 months ago
8553732b
fe40fb8b
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+2
-5
1 changed file
expand all
collapse all
unified
split
src
components
create.tsx
+2
-5
src/components/create.tsx
···
151
151
};
152
152
153
153
const dragBox = (box: HTMLDivElement) => {
154
154
-
let currentBox: HTMLDivElement | null = null;
155
154
let isDragging = false;
156
155
let offsetX: number;
157
156
let offsetY: number;
···
171
170
e.preventDefault();
172
171
isDragging = true;
173
172
box.classList.add("cursor-grabbing");
174
174
-
currentBox = box;
175
173
176
174
const rect = box.getBoundingClientRect();
177
175
···
185
183
};
186
184
187
185
const handleMouseMove = (e: MouseEvent) => {
188
188
-
if (isDragging && box === currentBox) {
186
186
+
if (isDragging) {
189
187
let newLeft = e.clientX - offsetX;
190
188
let newTop = e.clientY - offsetY;
191
189
···
204
202
};
205
203
206
204
const handleMouseUp = () => {
207
207
-
if (isDragging && box === currentBox) {
205
205
+
if (isDragging) {
208
206
isDragging = false;
209
207
box.classList.remove("cursor-grabbing");
210
210
-
currentBox = null;
211
208
}
212
209
};
213
210