Skip to content

Commit d289dbc

Browse files
committed
fix: info box for non-editable elements not appearing when highlight on hover is false
1 parent 1373bca commit d289dbc

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3710,7 +3710,7 @@ function RemoteFunctions(config = {}) {
37103710
function onMouseOver(event) {
37113711
if (_validEvent(event)) {
37123712
const element = event.target;
3713-
if(isElementEditable(element) && element.nodeType === Node.ELEMENT_NODE ) {
3713+
if(isElementInspectable(element) && element.nodeType === Node.ELEMENT_NODE ) {
37143714
_localHighlight.add(element, true);
37153715
}
37163716
}
@@ -3914,10 +3914,17 @@ function RemoteFunctions(config = {}) {
39143914
function onClick(event) {
39153915
const element = event.target;
39163916

3917-
if(isElementEditable(element)) {
3917+
if(isElementInspectable(element)) {
39183918
event.preventDefault();
39193919
event.stopPropagation();
39203920
event.stopImmediatePropagation();
3921+
3922+
// when in click mode, only select dynamic elements (without data-brackets-id) directly
3923+
// as for static elements, the editor will handle selection via highlight message
3924+
if (!shouldShowHighlightOnHover() && !element.hasAttribute("data-brackets-id")) {
3925+
_selectElement(element);
3926+
}
3927+
39213928
activateHoverLock();
39223929
}
39233930
}

0 commit comments

Comments
 (0)