Skip to content

Commit 3fdf721

Browse files
committed
feat: show a outline over the target element
1 parent b3b1b60 commit 3fdf721

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,15 @@ function RemoteFunctions(config = {}) {
10361036
}
10371037
element.style.backgroundColor = "rgba(66, 133, 244, 0.22)";
10381038

1039+
// when not dropping inside we add a light outline
1040+
// because for inside we already show a thick dashed border
1041+
if (dropZone !== "inside") {
1042+
if (element._originalDragOutline === undefined) {
1043+
element._originalDragOutline = element.style.outline;
1044+
}
1045+
element.style.outline = "1px solid #4285F4";
1046+
}
1047+
10391048
// create the marker element
10401049
let marker = window.document.createElement("div");
10411050

@@ -1206,6 +1215,10 @@ function RemoteFunctions(config = {}) {
12061215
elements[j].style.backgroundColor = elements[j]._originalDragBackgroundColor;
12071216
delete elements[j]._originalDragBackgroundColor;
12081217
}
1218+
if (elements[j]._originalDragOutline !== undefined) {
1219+
elements[j].style.outline = elements[j]._originalDragOutline;
1220+
delete elements[j]._originalDragOutline;
1221+
}
12091222
if (elements[j]._originalDragTransform !== undefined) {
12101223
elements[j].style.transform = elements[j]._originalDragTransform;
12111224
delete elements[j]._originalDragTransform;

0 commit comments

Comments
 (0)