JSFiddle - React, Tailwind, and code Playground
HTML
<textarea>This is a test</textarea>
JavaScript
$("textarea").on("focus", function(event) {
event.preventDefault();
setTimeout(function() { $(event.target).select(); }, 1);
});
<textarea>This is a test</textarea>
$("textarea").on("focus", function(event) {
event.preventDefault();
setTimeout(function() { $(event.target).select(); }, 1);
});