JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.js"></script>
<div id="test">
<input type="text" id="box" />
</div>
JavaScript
$('#box').datepicker();
$('#box').bind('change', function() {
var test = 'test';
test.validator = null;
var i = test.validator.length;
});
$('#box').val('test');
var now = new Date();
$('#box').datepicker('setDate', now.getDate());
$('#box').datepicker('getDate');
// Date changes in textbox, but datepicker does not close due to error. The function for 'change' simulates a undefined collection of validators, like in our problem.