…meie igapäevast IT’d anna meile igapäev…


Missing caret in Firefox: a fix

Filed under: Firefox,Nipid — Sander @ 11:05:11

Firefox-logo There are a lot of posts in forums and blogs about caret going missing (becoming invisible) in Firefox (<input> text and password, textarea). It is supposedly fixed in Firefox 3, but still happened to me with FF3 beta 5 and my Estonian-English-Estonian dictionary.

So I went googling for a solution – there were quite a lot of different solutions: div to overflow: hidden;, position:fixed; to position:auto;, change z-index and so forth.

None of the fixes worked for me, cursor was still missing. However, I tracked the bug to disabling of the editbox – if it wasn’t disabled during AJAX query, then the cursor did not disappear. Long story short – it seems that the issue only occurred when editbox was the active control (i.e., caret was in the editbox). So, the solution that worked for me was simply to move caret away before disabling the form elements (element.Blur;):

function disableForm(dowhat) 
  frm = document.getElementById("searchform");  
  for (i = 0; i < frm.length; i++)
    frm.elements[i].disabled = dowhat;    

This may or may not work for you – but it worked for me.

1 kommentaar »

  1. Very strange bug. I’ve never encountered it or I just don’t pay attention to the carret. Though, the testcases indeed showed me the bug is there with ff2

    Kommentaar kirjutas KT — 2008-04-14 @ 15:18:13 | Vasta

RSS feed for comments on this post. TrackBack URI

Lisa kommentaar

Täida nõutavad väljad või kliki ikoonile, et sisse logida:

WordPress.com Logo

Sa kommenteerid kasutades oma WordPress.com kontot. Logi välja /  Muuda )

Google photo

Sa kommenteerid kasutades oma Google kontot. Logi välja /  Muuda )

Twitter picture

Sa kommenteerid kasutades oma Twitter kontot. Logi välja /  Muuda )

Facebook photo

Sa kommenteerid kasutades oma Facebook kontot. Logi välja /  Muuda )

Connecting to %s

Blog at WordPress.com.