Firefox textbox blinking problem

March 30th, 2008  | Tags:

Today I encountered a weird bug in Firefox where the cursor was not showing up and blinking in a text box that I had on the web page I was working on. This was really annoying because it was hard to tell which text box was focused on and which one was being typed into.

It turns out that the problem was with a text box inside a div that had its position style attribute set to absolute. After playing around I found out that wrapping the text box in a div and setting the overflow: auto, fixed the problem. Actually searching for and reading the official Firefox bug report also confirmed that this was the way to fix it.

FireFox bug:

<div style="position:absolute;">
  <input type="text">
</div>
<!-- this will cause the cursor to not show up and blink-->

Fixing the bug:

<div style="position:absolute;">
  <div style="overflow:auto;">
    <input type="text">
  </div>
</div>
<!-- this will show the cursor blinking in the textbox -->

Hope that saves you some time!

  1. rick
    April 1st, 2008 at 02:50
    Reply | Quote | #1

    i m facing the same problem
    but i hv a scrolling div i.e. when i scroll down the vertical bar , the div maintains its position in the center of the browser
    in this case overflow;auto is not working

    any solution
    thanks
    rick

  2. Leo F. Swiontek
    April 2nd, 2008 at 21:45
    Reply | Quote | #2

    Good solution for Firefox textbox blinking problem.Now we can fix easily.

TOP