luoye-fe/dom-inspector

prevent click event on selected element

danielravina opened this issue · 2 comments

Hi there,

Thank you for making this cool project.
is it possible to somehow disable the click event when an element is selected?

Thanks

Maybe you can directly disable the click event when enable dom inspect.

.inspect-content * {
    /* disable all mouse events on subElements */
    pointer-events: none; 
}

OR

let enableInspector = false; // just modify that variable to disable all clics events

document.addEventListener("click", freezeClicFn, true);

function freezeClicFn(e) {
    if (freezeClic) {
        e.stopPropagation();
        e.preventDefault();
    }
}

@luoye-fe I used the JS. it didn't work so I added extra listeners on mousedown and now it's working perfectly. Thanks!