Closed Bug 895236 Opened 6 years ago Closed 6 years ago

Cannot select a single search term in the URL bar

Categories

(Firefox for Android :: Awesomescreen, defect)

23 Branch
ARM
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 25

People

(Reporter: mozilla-bugs, Assigned: jchen)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36

Steps to reproduce:

(Using Nexus 4 with Google Keyboard.)
- Tap the URL bar
- Type 2 or more words and press the search key to perform a search
- Tap the URL bar again
- Try to select a word by long-pressing it


Actual results:

The whole search is selected, not just the search term under the cursor.


Expected results:

The word under the cursor should be selected, as happens in every other Android app.
While completely changing the search is a useful function on a mobile device (because opening/closing tabs takes more time), it's also extremely common to modify a search, and word selection is important to do that quickly.
OS: Mac OS X → Android
Hardware: x86 → ARM
Seeing the steps from Bug 861943 and the steps from this one, which is the expected behaviour? The whole search or only one word of the URL should be selected?
Flags: needinfo?(bugmail.mozilla)
I don't see any contradiction between that bug and this one. Both bugs are about the ability to select only part of the content of the url entry field. I agree that there should be a way to select individual words in the search query.
Flags: needinfo?(bugmail.mozilla)
Currently, we select all text in the URL bar on long press, but seems like we should have different behaviors for URLs and search terms.

For URLs, long press should select the entire URL (rather than a word) because a common usage is to select all and copy the URL.

For search terms, long press should only select a word to match Android behavior elsewhere.

Do you have an opinion on this, Ian?
Status: UNCONFIRMED → NEW
Component: Text Selection → Awesomescreen
Ever confirmed: true
Flags: needinfo?(ibarlow)
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #3)
> I don't see any contradiction between that bug and this one. Both bugs are
> about the ability to select only part of the content of the url entry field.
> I agree that there should be a way to select individual words in the search
> query.

Oh, I totally misread my own bug... Ignore this comment :) What Jim said in comment 4 makes sense.
I agree with Jim's comment 4 as well, though I would clarify that I don't think the initial touch behavior should change--that is, when someone short-presses the URL bar to open the awesome screen, the URL bar should select-all, as is the current behavior.
(In reply to Jim Chen [:jchen :nchen] from comment #4)
> For search terms, long press should only select a word to match Android
> behavior elsewhere.
> 
> Do you have an opinion on this, Ian?

This makes total sense to me. It'd be a very nice detail to have.
Flags: needinfo?(ibarlow)
Turns out much of the code is there already; just need a one line fix.
Attachment #778517 - Flags: review?(sriram)
Comment on attachment 778517 [details] [diff] [review]
Bug 895236 - Make URL bar inputType and imeOptions consistent; r=

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

I don't understand why this patch would work :(
I hope this works.
Attachment #778517 - Flags: review?(sriram) → review+
(In reply to Sriram Ramasubramanian [:sriram] from comment #9)
> Comment on attachment 778517 [details] [diff] [review]
> Bug 895236 - Make URL bar inputType and imeOptions consistent; r=
> 
> Review of attachment 778517 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> I don't understand why this patch would work :(
> I hope this works.

In AwesomeBar.java, we change inputType and imeOptions together to switch between URL mode and search mode. But because of this bug, initially inputType and imeOptions are mismatched, making us treat search terms as URLs initially. This leads to bugs like this where long-pressing in search mode selects the whole text (which is the correct behavior for URL mode).
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bfe1b9a06403
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
Depends on: 900011
You need to log in before you can comment on or make changes to this bug.