JSFiddle - React, Tailwind, and code Playground
HTML
<div>
<select id="test" class="shit" style="width: 99%;">
<option>Option 1</option>
<option>Option 2</option>
</select>
<div>
SCSS
#test {
position:absolute;
left:-9999999px;
}
div {
position:relative;
height:250px;
background:yellow;
}
#test.show {
position:relative;
left:auto;
}
JavaScript
$(function () {
$('#test').addClass('show');
alert('Outer width when visible: ' + $('#test').outerWidth());
$('#test').removeClass('show');
alert('Outer width when hidden: ' + $('#test').outerWidth());
setTimeout(function(){
$('#test').addClass('show');
alert('Outer width when visible: ' + $('#test').outerWidth());
},2000);
});