Closed Bug 836589 Opened 11 years ago Closed 11 years ago

"New Tab" input switches from numbers to letters after one digit

Categories

(Firefox for Android Graveyard :: Keyboards and IME, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: Biesinger, Assigned: jchen)

References

Details

(Keywords: reproducible)

Attachments

(1 file, 1 obsolete file)

21.0a1 (Trunk) Nightly from 2013-01-30
Nexus 4 phone with Android 4.2.1

Steps to reproduce:
- Click "New Tab"
- Switch keyboard to number mode
- Enter "12" in the input field

Actual results:
After entering "1" the keyboard switched to letter mode so you entered "1w"

Expected results:
Keyboard stays in number mode and you successfully entered 12
It seems like this only happens when there is a current value; this is reproducible by just tapping on the AwesomeBar, no need for a new tab.
Flags: needinfo?(nchen)
Keywords: reproducible
OS: Linux → Android
Hardware: x86_64 → ARM
This patch makes us switch between search and URL modes only when we are certain the text has a new mode. In ambiguous cases where the text can be either search or URL, we keep the current status. This way, we will not try to switch modes when the user is in the middle of inputting numbers.
Attachment #710754 - Flags: review?(blassey.bugs)
Flags: needinfo?(nchen)
Comment on attachment 710754 [details] [diff] [review]
Lazily switch between AwesomeBar search and URL modes (v1)

hm... does this mean if I enter "http:", the keyboard would still switch from symbol mode to letter mode as soon as I get to the colon, thus requiring a switch back to symbol mode for the slashes?

why are you doing anything at all to the keyboard?
(In reply to Christian :Biesinger (don't email me, ping me on IRC) from comment #3)
> Comment on attachment 710754 [details] [diff] [review]
> Lazily switch between AwesomeBar search and URL modes (v1)
> 
> hm... does this mean if I enter "http:", the keyboard would still switch
> from symbol mode to letter mode as soon as I get to the colon, thus
> requiring a switch back to symbol mode for the slashes?

When you tap on the AwesomeBar, it's already in URL mode. So there would be no switch in that case.

> why are you doing anything at all to the keyboard?

I think it was mostly for UX. Many keyboards show different keys for URL mode and text mode. The user can enter either a URL or a search in the AwesomeBar, and depending on what we think the user is entering, we want to the keyboard to adapt to that. This feature was originally introduced in Fennec 11.
Comment on attachment 710754 [details] [diff] [review]
Lazily switch between AwesomeBar search and URL modes (v1)

Review of attachment 710754 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/AwesomeBar.java
@@ +337,5 @@
>              int optionBits = mText.getImeOptions() & ~EditorInfo.IME_MASK_ACTION;
>              mText.setImeOptions(optionBits | imeAction);
>  
> +            mDelayRestartInput = imeAction == EditorInfo.IME_ACTION_GO &&
> +                                 InputMethods.shouldDelayAwesomebarUpdate(mText.getContext());

use a couple parenthesis to make this a bit more readable

::: mobile/android/base/util/StringUtils.java
@@ +18,5 @@
>       *  foo.c
>       *  :foo
>       *  http://foo.com bar
>      */
>      public static boolean isSearchQuery(String text) {

just fix the one other caller to pass in wasSearchQuery
Attachment #710754 - Flags: review?(blassey.bugs) → review+
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/c362e5037dcc
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Depends on: 852633
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: