Asfak's Blog

Link: Cursor (caret) sometimes fails to appear in input or textarea

Advertisements

Link: https://bugzilla.mozilla.org/show_bug.cgi?id=167801
Look at comment 112.

copied and pasted from the link

I’ve had this problem in FF3 but this time not related to iframe or overflow
setting but because of disabling input for a moment.

If someone stumbles upon same issue, this may help:

Testcase to reproduce problem:
textarea.disabled = true;
setTimeout(function() {
textarea.disabled = false;
textarea.focus();
}, 0);

How to fix it:

textarea.blur(); // blur first
textarea.disabled = true;
setTimeout(function() {
textarea.disabled = false;
textarea.focus();
}, 0);

Advertisements