JSFiddle - React, Tailwind, and code Playground
HTML
<div contenteditable onfocus="$('#output').append('focus ('+ (new Date().getTime()) +')<br/>');" id="d1" style='background-color: red;'>editable div</div>
<button onclick="$('#d1').focus();">trigger focus width JQuery</button>
<button onclick="document.getElementById('d1').focus();">trigger focus width native JS</button>
<div id='output' style='margin: 100px; background-color: black; color: white; padding: 20px; width: 200px;'></div>