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

2008-04-14

Missing caret in Firefox: a fix

Rubriigid: Firefox, Nipid — dukelupus @ 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

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


Selle postituse kommentaaride RSS-voog. TrackBack URI

Lisa kommentaar

Blog at WordPress.com.