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

2008-04-14

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].Blur;
    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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Muuda )

Twitter picture

You are commenting using your Twitter account. Log Out / Muuda )

Facebook photo

You are commenting using your Facebook account. Log Out / Muuda )

Google+ photo

You are commenting using your Google+ account. Log Out / Muuda )

Connecting to %s

Blog at WordPress.com.