Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Datepicker hangs when input field is re-clicked (Chrome)
    text
    copied!<p>I have this jsFiddle: <a href="http://jsfiddle.net/VebTY/" rel="nofollow">http://jsfiddle.net/VebTY/</a></p> <p>It looks this this is only an issue in chrome.</p> <p>When you click on a an item in the page, it adds a text field, and then a date picker pops up. When you click out of the text box then back into the text box the browser hangs for 5 - 10 seconds. Why is it doing that and how can I fix it?</p> <p>Here is my relevant code:</p> <pre><code>$(document).on("focus", "td input[type=text]", function(e) { e.stopPropagation(); if ($(this).closest("td").attr("data-type") === "date") { var dt = $(this).val(); $(this).not(".hasDatePicker").datepicker(); $(this).datepicker("setDate", dt); } }); $(".editable").click(function(e) { if (!$(e.target).is('input, textarea')) { $(".editable").each(function() { if ($(this).has("input")) { var v = $(this).children("input.input, textarea").attr("data-orig"); $(this).text(v); } }); var type = $(this).attr("data-type"); var val = $(this).text(); if (type === "text" || type === "date") { str = '&lt;input type="text" data-orig="' + val + '" onfocus="this.value = this.value;" class="input" style="width: 100%;" value="' + val + '" /&gt;&lt;br /&gt;'; } else if (type === "textarea") { str = '&lt;textarea class="input" data-orig="' + val + '" onfocus="this.value = this.value;" style="width: 100%;"&gt;' + val + '&lt;/textarea&gt;&lt;br /&gt;'; } str += '&lt;input type="button" class="save-edit" value="Save" /&gt;'; str += '&lt;input type="button" class="cancel-edit" value="Cancel" /&gt;'; $(this).html(str); $(this).find("input[type=text], textarea").focus(); } }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload