3 ms·
The approach I have seen is to apply the cursor you want to the entire body using JS so even if your cursor momentarily escapes the element the wanted cursor is
by jaflo 5y ago
The approach I have seen is to apply the cursor you want to the entire body using JS so even if your cursor momentarily escapes the element the wanted cursor is shown. You just need to make sure to revert back to the default cursor when the users stops dragging or the window loses focus.
- jancsika 5y agoThanks, jaflo. I use the JS body approach, but I was hoping I was missing a declarative option. Even JS has the PointerEvent so that you can encapsulate behaviors like dragging inside a single DOM element without having to set state for a parent element like body. I was hoping CSS had something analogous (though I can't currently think of how it would work).