Closed Bug 540506 Opened 10 years ago Closed 10 years ago

when focus is in the search box of the addons manager and you close the browser tools, keyboard stays up

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: blassey, Assigned: mbrubeck)

Details

Attachments

(1 file, 1 obsolete file)

it would seem that focus is still in the search box of the addons manager, we should force it to something else when you close the browser tools
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Attached patch patch (obsolete) — Splinter Review
This patch fixes a related problem where the search box retains focus when switching panes in the tool panel.

I couldn't repro/test the problem when closing the panel, probably because I'm not running on a platform with a software keyboard.  I can come back to this when my N900 arrives.  Also, it seems like there must be a better way to fix this.
I can reproduce this on Android now, will work on a fix.
OS: All → Android
Attached patch patchSplinter Review
This patch fixes the bug, though it seems like maybe there should be a better way.  Should an element be blurred automatically when its container is hidden?
Attachment #439322 - Attachment is obsolete: true
Attachment #449266 - Flags: review?(mark.finkle)
Attachment #449266 - Flags: review?(mark.finkle) → review+
Comment on attachment 449266 [details] [diff] [review]
patch

>diff -r 4bca89b9a357 chrome/content/browser-ui.js

>+  blurFocusedElement: function blurFocusedElement() {
>+    let focusedElement = document.commandDispatcher.focusedElement;
>+    if (focusedElement)
>+      focusedElement.blur();
>+  },

This might be better in Util.js - whoever checks in can move it there.

Also, I noticed that we use gFocusManager.focusedElement (and gFocusManager in general) when dealing with focus, except in bindings.xml.

I'd like Vivien to give feedback on using gFocusManager or leaving it as commandDispatcher.focusedElement.
Comment on attachment 449266 [details] [diff] [review]
patch

I think using the commandDispatcher is fine in this case: we want to redefine the focusedElement of the chrome window and we probably don't care of other windows.
Attachment #449266 - Flags: feedback?(21) → feedback+
pushed to m-b:
http://hg.mozilla.org/mobile-browser/rev/74295e05a514
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Bug no longer reproducible with:
Build ID: Mozilla/5.0 (Android; Linux armv7l; rv:10.0a1) Gecko/20111014 Firefox/10.0a1 Fennec/10.0a1
Device: Motorola Droid 2
OS: Android 2.3

Verifying bug.
Status: RESOLVED → VERIFIED
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.