The view's selected result and UrlbarInput._resultForCurrentValue aren't cleared when the view is cleared.
Categories
(Firefox :: Address Bar, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: adw, Assigned: adw)
References
Details
Attachments
(1 file)
As I was working on bug 1659204, I found that both the view's selected result and UrlbarInput._resultForCurrentValue
stick around after the view has been cleared and is therefore showing no results. That's conceptually wrong, and the practical effect I was seeing is that it interferes with UrlbarInput.handleNavigation
. Without clearing the view's selected index, handleNavigation
calls pickResult
on it. Then, without clearing _resultForCurrentValue
, handleNavigation
calls pickResult
on it. In either case, handleNavigation
ends up loading a URL that isn't present in the current query's results.
Assignee | ||
Comment 1•4 years ago
|
||
First, UrlbarView.clear
needs to null the selected element. Second, setting the selected element to null needs to also null UrlbarInput._resultForCurrentValue
. UrlbarView._selectElement
does call input.setValueFromResult
, which sets _resultForCurrentValue
-- but not if the updateInput
arg is false. So I added a new UrlbarInput.setResultForCurrentValue
method so _selectElement
can set it. At first I tried unconditionally calling calling input.setValueFromResult
, but a bunch of tests failed. I looked into it, but it's complicated and I ended up modifying a bunch of seemingly unrelated stuff, so I gave up and took the simple route by adding this new method.
This also makes some other changes that I'll comment on inline.
Assignee | ||
Comment 2•4 years ago
|
||
Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ba78b5783f6 Clear the view's selected result and UrlbarInput._resultForCurrentValue when the view is cleared. r=harry
Comment 4•4 years ago
|
||
bugherder |
Description
•