JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<button id="btn1">open</button>
<div id="_query_">
<p>dialog</p>
<input id='tt1'>
<input >
</div>
T<input id='t'>t1<input id='t1'>
JavaScript
(function($){
$.extend($.fn.window.methods, {
watchTab: function(jq){
return jq.each(function(){
var opts = $(this).window('options');
$(this).unbind('.watchTab').bind('keydown.watchTab', function(e){
if (opts.modal && e.keyCode == 9){
var first = $(this).find(':enabled:visible:first');
var last = $(this).find(':enabled:visible:last');
if (e.target == last[0] && !e.shiftKey){
first.focus();
return false;
} else if (e.target == first[0] && e.shiftKey){
last.focus();
return false;
}
}
})
})
}
})
})(jQuery);
$('#t').textbox();
$('#t1').textbox();
$('#_query_').window({
modal: true,
title: 'My Modal',
width: 400,
height:'auto',
closed:true
});
$('#_query_').window('watchTab');
$('#_query_').window().append($('<input id="tt3">'));
$('#_query_').window().append($('<button id="tt4">yo</button>'));
$('#tt4').linkbutton();
$('#btn1').click(function(){
var dl = $('#_query_');
dl.window('open');
dl.window('move',{left:50,top:50});
$('#tt1').focus();
});