JSFiddle - React, Tailwind, and code Playground

HTML

<div><span>First select this text and then drag it. Why does it only detect mousedown, but not mouseup?</span></div>

CSS

div,body{position:absolute;right:0;left:0;top:0;bottom:0;}
span{font-size:30px;}

JavaScript

mouse_down = false;

$('body').on('mousedown', function(e) {
    mouse_down = true;

    console.log(mouse_down);

}).on('mouseup', function(e) {
    mouse_down = false;
    console.log(mouse_down);
});