select element on a jstree node closes immediately upon click. input loses focus similarly, but can be solved with JavaScript. However, it does not fix the problem with select. Below is a minimum reproducible example. How can I fix it?
$('#jstree').jstree({
core: {
data: [
{text:`Select <select><option>1</option><option>2</option></select>`},
{text:`Input <input type="text">`},
]
}
});
$(document).on("click", "input, select", (e) => {
// e.target.focus(); // fixes the problem only for input
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.12/themes/default/style.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.12/jstree.min.js"></script>
<div id="jstree"></div>