JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<br><br><br><br><br><br><br><br><br><br>
<div> <a id="click-me" href="#bottom">Click me</a>

</div>
<div>
    <textarea id="myTxtArea" style="height: 2000px"></textarea>
</div>
<div> <a id="bottom" name="bottom"></a>

</div>
<div data-role="dialog" id="myDialog"></div>

JavaScript

$(function () {
    $('#click-me').click(function () {
        var pos = $(document).scrollTop(); // get current position
       // $('textarea').focus();
        setTimeout(function () {
            $('#myDialog').text('Close me please!').dialog({
                modal: true,
                close: function (event, ui) {
                    console.log("dialog has closed");
                   // $('#myTxtArea').blur();
                    $("html, body").scrollTop(pos);
                }
            });
        });
    });
});