Skip to content

Commit fab6da0

Browse files
committed
fix: remove background color property when an element is clicked
1 parent 207da0b commit fab6da0

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,6 @@ function RemoteFunctions(config = {}) {
688688
const outlineColor = element.hasAttribute(GLOBALS.DATA_BRACKETS_ID_ATTR) ? "#4285F4" : "#3C3F41";
689689
element.style.outline = `1px solid ${outlineColor}`;
690690

691-
// Only apply background tint for editable elements (not for dynamic/read-only)
692-
if (element.hasAttribute(GLOBALS.DATA_BRACKETS_ID_ATTR)) {
693-
if (element._originalBackgroundColor === undefined) {
694-
element._originalBackgroundColor = element.style.backgroundColor;
695-
}
696-
element.style.backgroundColor = "rgba(0, 162, 255, 0.2)";
697-
}
698-
699691
if (!_clickHighlight) {
700692
_clickHighlight = new Highlight("#cfc");
701693
}
@@ -1194,16 +1186,7 @@ function RemoteFunctions(config = {}) {
11941186
* when config is changed we clear all the highlighting and stuff
11951187
*/
11961188
function _handleConfigurationChange() {
1197-
if (_hoverHighlight) {
1198-
_hoverHighlight.clear();
1199-
}
1200-
cleanupPreviousElementState();
1201-
const allElements = window.document.querySelectorAll(`[${GLOBALS.DATA_BRACKETS_ID_ATTR}]`);
1202-
for (let i = 0; i < allElements.length; i++) {
1203-
if (allElements[i]._originalBackgroundColor !== undefined) {
1204-
clearElementBackground(allElements[i]);
1205-
}
1206-
}
1189+
hideHighlight();
12071190
dismissUIAndCleanupState();
12081191
}
12091192

@@ -1219,7 +1202,6 @@ function RemoteFunctions(config = {}) {
12191202
}
12201203
delete previouslyClickedElement._originalOutline;
12211204

1222-
clearElementBackground(previouslyClickedElement);
12231205
hideHighlight();
12241206

12251207
// Notify handlers about cleanup

0 commit comments

Comments
 (0)