Open Bug 646622 Opened 12 years ago Updated 6 months ago

Address bar loses focus when autocomplete no longer matches typed input.


(Firefox :: General, defect)

4.0 Branch





(Reporter: bobvin, Unassigned)


(Whiteboard: [bugday-20110401])

User-Agent:       Mozilla/5.0 (X11; Linux i686; rv:2.0b13pre) Gecko/20110322 Firefox/4.0b13pre
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0b13pre) Gecko/20110322 Firefox/4.0b13pre

When typing an address into the addressbar, each letter typed refreshes the autocomplete list. The length of the autocomplete list depends on how many previously visited URLS matches the currently typed text.  When the number of matches becomes zero, the autocomplete list disappears (which is normal and expected), and the addressbar field loses focus (which is abnormal, unexpected, and highly annoying.)

I have found two ways to restore focus to the addressbar when this happens:

(1) Move the mouse pointer to the addressbar and click the left mouse button.

(2) Press the tab key.

Reproducible: Always

Steps to Reproduce:
1. Install Firefox 4.0 with a blank profile
2. Press Ctrl-L to highlight and focus the address bar.
3. Press the "m" key.
4. Press the "z" key.
5. Press the "." key.
6. Press the "c" key.
7. Press the "o" key.
8. Press the "m" key.
9. Press the Enter key.
Actual Results:  
The address bar contains "mz" and a blinking cursor, but does not accept further input. The following keypresses have no effect:

* Any single-key printable character.
* Ctrl-L, Enter, Esc, Backspace, Home, End, PgUp, PgDn, etc.

Pressing the Tab key once restores focus to the address bar.

Expected Results:  
The address bar should contain the actual text typed.  Regardless of the autocomplete history, it should not be necessary to use the Tab key to enter a URL from the address bar.

To visit "" with a freshly-installed Firefox profile:

1. Press "Ctrl-L" or click on the address bar.
2. Press the "m" key.
3. Press the "z" key.
4. Press the Tab key.
5. Press the "." key.
6. Press the "c" key.
7. Press the "o" key.
8. Press the "m" key.
9. Press the Enter key.
Of course, once the address has been visited once, the problem cannot be reproduced without clearing the history.  In other words, actually visiting the url solves the problem -- for that URL.

And if the autocomplete history is completely empty, then the number of matching entries *starts* at zero, and thus the problem will not occur.

The problem only happens when the first typed character matches a previously-visited URL, but further input does not match a previously-visited URL.
I'm not able to reproduce the bug.

Browsers tested:
Mozilla/5.0 (X11; Linux i686; rv:2.0) Gecko/20100101 Firefox/4.0
Mozilla/5.0 (X11; Linux i686; rv:2.0b13pre) Gecko/20110322 Firefox/4.0b13pre
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
Mozilla/5.0 (X11; Linux i686 on x86_64; rv:2.0b13pre) Gecko/20110322 Firefox/4.0b13pre
Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20110401 Firefox/4.2a1pre

I have used absolutely fresh profiles in each try, not even pressing a single key before following the proposed steps, but I do not lose focus anyway.

Am I missing something in the preparations?
Closed: 12 years ago
Resolution: --- → WORKSFORME
Whiteboard: [bugday-20110401]
Could be it only manifests in KDE.  Running Ubuntu 10.10 (Maverick Meerkat) with KDE 4.0.

Will try testing under another window-manager.
Resolution: WORKSFORME → ---
(In reply to comment #3)
> Could be it only manifests in KDE.  Running Ubuntu 10.10 (Maverick Meerkat)
> with KDE 4.0.
> Will try testing under another window-manager.

Just a heads up -- KDE is not officially supported.  That doesn't mean this bug is invalid, but we tend to focus our attention to fixing bugs on officially supported environments before all else. Nor do we ever test our builds on unsupported environments.

Thanks for looking into this for us.
Version: unspecified → 4.0 Branch
Bob, is this still an issue in current versions of Firefox?
It is for me, running Ubuntu 12.04 and ArchLinux (rolling release) on x86_64.

I removed the default installed firefox and downloaded one from Currently I'm running firefox 16.0.2 (64bit) and the
problem persists exactly as described in the initial report. 

Example: I'll enter 'g' 'l' and the urlbar will autocomplete all kinds of URLs that match a google-query I did in the past containing glibc. 

When next I enter 'x', the autocomplete fails to find any hits and disappears,
taking the focus with it. 

The only way for me to work around this is to run a 32bit firefox build on my
64bit Linux installation.

I also thought it might be Windowmanager related, so I switched from XFCE to KDE4 to AwesomeWm, but the problem persists.
Dunno -- I quit using Firefox because of this bug.
1. Installed Ubuntu 12.04 64-bit, including all updates
2. Installed XFCE4 and switched to an XFCE session
3. Installed Firefox 16.0.2 from
4. Type "glibc" in the address bar and press ENTER
> Google search results for "glibc" are loaded
5. Click the home button
6. Type "gl" in the address bar
> Single results for "glibc - Google search" appears in the awesombar dropdown
7. Continue to type
> Typing is successful

As you can see I am not able to reproduce this in a completely clean environment. I'm guessing there is something else going on here. Either add-ons, cache, or session data could be causing the problem for you. 

Unfortunately, we can't make any progress on this until a set of reproducible steps are identified.
Anthony Hugues -- You didn't follow my instructions.
You didn't follow Maarten's instructions either.
You didn't follow Maarten's instructions either.
I believe what I did follows the instructions in comment 6, as best as I understand them. Following your instructions in comment 0 with a KDE4 session installed doesn't reproduce this for me either. If you can provide any more details which might make this easier to reproduce, please do so.
Anthony, you are taking exactly the same steps as me (at least from your description). 

However, running Firefox 17, 64bit on the same setup as described before, I just got hit again by this bug. On a clean profile. Without any extensions. And only the flash-plugin.

I have been trying to consistently find this bug for over a year now and cannot get anywhere near a solution. There must be something. Could it somehow be hardware related in combination with a display driver perhaps?
I highly doubt it. Do you have any tabs or windows with content loaded? I'm testing this with a single tab open to the default home page. If you have other content loaded it could be something else stealing focus and coincidentally manifests itself in this behaviour.
Nope - just the single tab, showing the Mozilla Firefox Start Page. 

CTRL+L to the urlbar. Type something until autocomplete fails. Lose focus. 

Currently, I am running 3 different profiles at the same time. 2 of those have 'suddenly' this problem, the other not.

When I close firefox and start up the same profile (clean, no extensions, just flash plugin) again, the problem persists. I tried this about 10 times. 

I closed one of the other 3 profiles I had running. Problem persists.

Now I disable flash in one , restart. Problem goes away in the one, but remains in this very profile I'm typing this. Re-enable flash. Problem remains gone and I can no longer trigger the bug.
Do you see any errors in the Error Console (CTRL+SHFT+J) when you lose focus?
Error Console remains empty of any and almessages.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.