JSFiddle - React, Tailwind, and code Playground

HTML

<!--
The same behavior happens if you:

* Make it a `display: inline-flex;` and add `flex-flow: column;`
* Add `flex-flow: column;` and add `max-width: max-content;` to the flex item

Which also cause the flex item to size to its maximum content in the direction perpendicular to the scrollbar.
-->
<div style="display: flex;">
  <div style="height: 100px; overflow: auto;">
    <div style="height: 200px; width: 100px;"></div>
  </div>
</div>