Skip to content

Commit 1e97b9f

Browse files
devvaannshabose
authored andcommitted
fix: api getting called twice when image element was clicked in the live preview
1 parent 3b7c614 commit 1e97b9f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3274,22 +3274,16 @@ function RemoteFunctions(config = {}) {
32743274

32753275
/**
32763276
* This function handles the click event on the live preview DOM element
3277-
* it is to show the advanced DOM manipulation options in the live preview
3277+
* this just stops the propagation because otherwise users might not be able to edit buttons or hyperlinks etc
32783278
* @param {Event} event
32793279
*/
32803280
function onClick(event) {
3281-
dismissAIPromptBox();
32823281
const element = event.target;
32833282

3284-
// when user clicks on the HTML, BODY tags or elements inside HEAD, we want to remove the boxes
3285-
if(_nodeMoreOptionsBox && !isElementEditable(element)) {
3286-
dismissUIAndCleanupState();
3287-
} else if(isElementEditable(element)) {
3283+
if(isElementEditable(element)) {
32883284
event.preventDefault();
32893285
event.stopPropagation();
32903286
event.stopImmediatePropagation();
3291-
3292-
_selectElement(element);
32933287
}
32943288
}
32953289

0 commit comments

Comments
 (0)