JSFiddle - React, Tailwind, and code Playground

HTML

When you click in the input, I would like to select all the numbers.<br />
But if you click between 2 numbers, the selected is canceled by the typing cursor.<br /> Anyway to avoid that?
<br />
<input type="text" class="class-focusin" value="4578" />
<br /><br />
Regular input<br />
<input type="text" class="class-not-focusin" value="457887" /

JavaScript

$(".class-focusin").on("focus",function(e){
    $(this).select();
});

$(".class-focusin").on("mouseup",function(e){
    e.preventDefault();
});