DEV Community

Discussion on: Front-end Challenge: Prevent Clicks

Collapse
 
naimur profile image
Naimur Rahman

I just tried on devTools using pointer-events.

const addBlock = () => document.querySelector('body').style.pointerEvents = "none";
const removeBlock = () => document.querySelector('body').style.pointerEvents = "auto";

This worked on producthunt too with newly loaded products on scroll.

Collapse
 
entrptaher profile image
Md Abu Taher • Edited

This is a straightforward solution.

However, only this will not print the element under the mouse on click.