Skip to content

Commit cfa29f6

Browse files
committed
fix: hover listeners affecting inline editing
1 parent 63d558a commit cfa29f6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,14 @@ function RemoteFunctions(config = {}) {
718718
}
719719

720720
function enableHoverListeners() {
721+
// don't enable hover listeners if user is currently editing an element
722+
// this was added to fix a specific bug:
723+
// lets say user double clicked an element: so as soon as the first click is made,
724+
// 'breiflyDisableHoverListeners' is called which has a timer to re-enable hover listeners,
725+
// because of which even during editing the hover listeners were working
726+
if (SHARED_STATE._currentlyEditingElement) {
727+
return;
728+
}
721729
if (config.mode === 'edit' && shouldShowHighlightOnHover()) {
722730
disableHoverListeners();
723731
window.document.addEventListener("mouseover", onElementHover);

0 commit comments

Comments
 (0)