Back button does not dismiss the keyboard in awesomebar

VERIFIED FIXED in Firefox 13

Status

()

Firefox for Android
General
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: Paul Feher, Assigned: Margaret)

Tracking

Trunk
Firefox 14
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox13 fixed, firefox14 verified, blocking-fennec1.0 +)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
Nightly Fennec 14.0a1 (2012-03-28)
Build:20120328115435
http://hg.mozilla.org/mozilla-central/rev/c3fd0768d46a
Device: Samsung Nexus S
OS: Android 2.3.6

Steps to reproduce:
1. Perform a sync operation 
2. Tap on the bookmark section on awesome
3. Select any folder
4. Tap on the URL bar for the keyboard to appear
5. Tap the back button

Expected:
The keyboard is dismissed.

Actual
You move up a folder level in the bookmarks UI.
(Reporter)

Updated

6 years ago
Summary: Back button does not dismiss the keyboard → Back button does not dismiss the keyboard in awesomebar
(Assignee)

Comment 1

6 years ago
This is tricky, since code was added in bug 700951 to explicitly not dismiss the keyboard, but I guess this wasn't considered at that point since this bookmarks folder UI didn't exist then. It seems to me we want to make a special case for when the user explicitly brings up the keyboard, but I'm not sure how we can track that.
blocking-fennec1.0: --- → ?
(Assignee)

Comment 2

6 years ago
Created attachment 611078 [details] [diff] [review]
patch

I tried using imm.isActive() to check if the keyboard was showing, but I found that it always returned true, which wasn't helpful. However, I found that hideSoftInputFromWindow returns a boolean to indicate whether or not it successfully hid the keyboard, so I decided to take advantage of that.

I also expanded this bug to cover cases where the user brings up the soft keyboard in the history tab. Since we're explicitly hiding the keyboard when the user selects the bookmarks/history tab, if it's showing in one of those tabs, the user must have brought it up, so I think it makes sense to make the back button hide it in that case.
Assignee: nobody → margaret.leibovic
Attachment #611078 - Flags: review?(mark.finkle)
Comment on attachment 611078 [details] [diff] [review]
patch

>     public boolean onBackPressed() {
>+        // If the soft keyboard is visible in the bookmarks or history tab, the user
>+        // must have explictly brought it up, so we should try hiding it instead of
>+        // exiting the activity or going up a bookmarks folder level.
>+        if (getCurrentTabTag().equals(BOOKMARKS_TAB) ||
>+                getCurrentTabTag().equals(HISTORY_TAB)){

Feel free to let this on a single line. I'd rather have that than the indenting.

>         // also return false if mBookmarksAdapter hasn't been initialized yet.
>         if (!getCurrentTabTag().equals(BOOKMARKS_TAB) ||
>                 mBookmarksAdapter == null)

Can you roll this up on a single line too?

Your logic makes sense to me. Let's see if this handles the current situation well enough.
Attachment #611078 - Flags: review?(mark.finkle) → review+
(Assignee)

Comment 4

6 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a38635a80bd

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/8a38635a80bd
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
(Assignee)

Comment 6

6 years ago
Comment on attachment 611078 [details] [diff] [review]
patch

[Approval Request Comment]
User impact if declined: Inconsistent back button behavior in the awesome screen
Testing completed (on m-c, etc.): Landed on m-c 3/31
Risk to taking this patch (and alternatives if risky): Low risk, mobile-only change
Attachment #611078 - Flags: approval-mozilla-aurora?

Comment 7

6 years ago
Comment on attachment 611078 [details] [diff] [review]
patch

[Triage Comment]
Low risk, mobile-only Fennec fix. Approved for Aurora 13.
Attachment #611078 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Reporter)

Comment 8

6 years ago
Verified/fixed on:
Nightly Fennec 14.0a1 (2012-04-04)
Device: HTC Desire
OS: Android 2.2.2
Status: RESOLVED → VERIFIED
status-firefox14: --- → verified
https://hg.mozilla.org/releases/mozilla-aurora/rev/41600364e780
status-firefox13: --- → fixed
blocking-fennec1.0: ? → +
You need to log in before you can comment on or make changes to this bug.