Closed Bug 1482551 Opened Last year Closed Last year

Position the cursor at the end if searching the same text

Categories

(Firefox :: Address Bar, defect, P3)

defect

Tracking

()

VERIFIED FIXED
Firefox 63
Tracking Status
firefox62 --- verified
firefox63 --- verified

People

(Reporter: Mardak, Assigned: adw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxsearch])

Attachments

(2 files)

Bug 1480503 added a search() api that activity stream uses to prefill with "@google " or "@amazon" etc. Turns out if the address bar already has "@google ", it will select all the text when clicking the "@google" tile.

Interestingly, if the text in the address bar is different, e.g., clicking @google then @amazon, the cursor is correctly at the end.
Assignee: nobody → adw
Status: NEW → ASSIGNED
Duplicate of this bug: 1483630
adw, in the PR, we were about to work around the issue by setting `gURLBar.selectionStart = -1` after calling search.

Should be okay to just move that directly into the search method after setting textValue?

https://searchfox.org/mozilla-central/rev/2466b82b729765fb0a3ab62f812c1a96a7362478/browser/base/content/urlbarBindings.xml#1719
Flags: needinfo?(adw)
Comment on attachment 9001366 [details]
Bug 1482551 - avoid selecting url bar text on searches

Ed Lee :Mardak (PTO Aug 11-26) has approved the revision.
Attachment #9001366 - Flags: review+
Blocks: 1482398
Pushed by elee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/907a277d51d8
avoid selecting url bar text on searches r=Mardak
Whiteboard: [fxsearch]
https://hg.mozilla.org/mozilla-central/rev/907a277d51d8
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
(In reply to Ed Lee :Mardak (PTO Aug 11-26) from comment #3)
> adw, in the PR, we were about to work around the issue by setting
> `gURLBar.selectionStart = -1` after calling search.
> 
> Should be okay to just move that directly into the search method after
> setting textValue?
> 
> https://searchfox.org/mozilla-central/rev/
> 2466b82b729765fb0a3ab62f812c1a96a7362478/browser/base/content/urlbarBindings.
> xml#1719

Yes, sorry for dropping the ball on this needinfo.
Flags: needinfo?(adw)
I have verified that the issue is no longer reproducible in the latest Nightly (63.0a1, Build ID 20180816100035) and Beta (62.0b18 Build ID 20180816151750) on Windows 10, Mac 10.13 and Arch Linux x64. Subsequent clicks on the same or a different search shortcut will autocomplete the name and leave the cursor at the end of the sting, after an empty space.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.