JSFiddle - React, Tailwind, and code Playground
HTML
<div id="both" data-role="popup" data-theme="e" data-overlay-theme="a" class="ui-content">
...Popup contents...
</div>
<select id="message-commands">
<option value="nothing">Nothing</option>
<option value="add">Add</option>
<option value="cancel">cancel</option>
</select>
<a href="#both" data-rel="popup">Open Dialog</a>
JavaScript
$("#message-commands").on("change", function (event, ui) {
var value = event.target.value;
switch (value) {
case "add":
setTimeout(function () {
$('#both').popup('open');
}, 100);
break;
}
});