JSFiddle - React, Tailwind, and code Playground

by lollero

JavaScript

// This to slideBtn hold feature. 
// - If mouse goes out of viewport while holding,
//   release the button "forcefully".
// - Without this, the holding would still be active when returning
//   back into the viewport without holding anymore.

$(window).on("mouseleave", release);

function release() {

    console.log('Mouseleave');
    
}