JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<style>div div{height: 30px;}</style>
<input type="text">
<div style="height: 60px; overflow-y: scroll; width: 40px;">
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <div>4</div>
</div>
<script>
  
    $('input').trigger('focus').on('focusout', function () {
        $(this).hide().next().hide();
    });
</script>