JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="http://automattic.github.io/Iris/javascripts/iris.min.js"></script>
<link rel="stylesheet" href="https://raw.githubusercontent.com/Automattic/Iris/master/src/iris.css">
<input type="text" class="my-color-picker" id='color-picker' value="#bada55" />
JavaScript
jQuery(document).ready(function ($) {
$('.my-color-picker').iris();
$(document).click(function (e) {
if (!$(e.target).is(".my-color-picker, .iris-picker, .iris-picker-inner")) {
$('.my-color-picker').iris('hide');
return false;
}
});
$('.my-color-picker').click(function (event) {
$('.my-color-picker').iris('hide');
$(this).iris('show');
return false;
});
});