Skip to content

Commit c5a0bb4

Browse files
committed
fix: element click not working after mode switch on same element
1 parent 208a02a commit c5a0bb4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -765,12 +765,8 @@ function RemoteFunctions(config = {}) {
765765
});
766766
}
767767

768-
// we call the select element function only when the element is not editable (JS generated content)
769-
// because for editable elements, highlightRule function already calls selectElement internally
770-
if (!LivePreviewView.isElementEditable(element)) {
771-
selectElement(element);
772-
}
773768
brieflyDisableHoverListeners();
769+
selectElement(element);
774770
}
775771

776772
// remove active highlights
@@ -814,6 +810,12 @@ function RemoteFunctions(config = {}) {
814810
let foundValidElement = false;
815811
for (i = 0; i < nodes.length; i++) {
816812
if(LivePreviewView.isElementInspectable(nodes[i], true) && nodes[i].tagName !== "BR") {
813+
// if hover lock timer is active, we don't call selectElement as,
814+
// it means that its already called by handleElementClick function
815+
if (_hoverLockTimer && nodes[i] === previouslyClickedElement) {
816+
foundValidElement = true;
817+
break;
818+
}
817819
selectElement(nodes[i]);
818820
foundValidElement = true;
819821
break;

0 commit comments

Comments
 (0)