Skip to content

Commit f9a27bf

Browse files
committed
fix: remove background color property when an element is clicked
1 parent 1ea06f2 commit f9a27bf

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
@@ -695,14 +695,6 @@ function RemoteFunctions(config = {}) {
695695
const outlineColor = element.hasAttribute(GLOBALS.DATA_BRACKETS_ID_ATTR) ? "#4285F4" : "#3C3F41";
696696
element.style.outline = `1px solid ${outlineColor}`;
697697

698-
// Only apply background tint for editable elements (not for dynamic/read-only)
699-
if (element.hasAttribute(GLOBALS.DATA_BRACKETS_ID_ATTR)) {
700-
if (element._originalBackgroundColor === undefined) {
701-
element._originalBackgroundColor = element.style.backgroundColor;
702-
}
703-
element.style.backgroundColor = "rgba(0, 162, 255, 0.2)";
704-
}
705-
706698
if (!_clickHighlight) {
707699
_clickHighlight = new Highlight("#cfc");
708700
}
@@ -1201,16 +1193,7 @@ function RemoteFunctions(config = {}) {
12011193
* when config is changed we clear all the highlighting and stuff
12021194
*/
12031195
function _handleConfigurationChange() {
1204-
if (_hoverHighlight) {
1205-
_hoverHighlight.clear();
1206-
}
1207-
cleanupPreviousElementState();
1208-
const allElements = window.document.querySelectorAll(`[${GLOBALS.DATA_BRACKETS_ID_ATTR}]`);
1209-
for (let i = 0; i < allElements.length; i++) {
1210-
if (allElements[i]._originalBackgroundColor !== undefined) {
1211-
clearElementBackground(allElements[i]);
1212-
}
1213-
}
1196+
hideHighlight();
12141197
dismissUIAndCleanupState();
12151198
}
12161199

@@ -1226,7 +1209,6 @@ function RemoteFunctions(config = {}) {
12261209
}
12271210
delete previouslyClickedElement._originalOutline;
12281211

1229-
clearElementBackground(previouslyClickedElement);
12301212
hideHighlight();
12311213

12321214
// Notify handlers about cleanup

0 commit comments

Comments
 (0)