Clicking the block or result menu button with a valid page proxy state makes the page proxy state invalid
Categories
(Firefox :: Address Bar, defect, P2)
Tracking
()
People
(Reporter: adw, Assigned: adw)
References
Details
Attachments
(1 file)
STR
- Enable
browser.urlbar.resultMenu
, or add block buttons to top sites results, or add a provider for empty search strings whose results include block buttons - Open http://example.com/ in a new tab (any URL will do)
- Click in the urlbar to show the top sites view
- Click a result menu button or block button
On mouseup, the page proxy state becomes invalid and whatever is in the input becomes the search string, so if you click in the urlbar again, you get a search for that search string instead of the top sites.
This happens because on mouseup the view calls #selectElement(null)
, which updates the input.
Adding { updateInput: false }
to the call fixes the problem for the result menu button, but for the block button, it reveals another problem where the input value is set to the URL of the next row but no row is visually selected. That happens because of two things: (1) the input value is set due to onQueryResultRemoved()
setting the selected row index to the index of the row after the removed row -- so far so good -- but then (2) the #selectElement(null)
inside on_mouseup()
is reached and the selecton is cleared.
This is a problem for the weather suggestion since it will have a block button and it's shown in the top sites view. All this logic is surprisingly complex and kind of brittle and I think it would be simplest to just not select buttons when they're clicked.
Assignee | ||
Comment 1•2 years ago
|
||
This stops selecting buttons on mousedown so that selection and the input remain
in a sensible state after clicking the block button while top sites are showing
(e.g., in the weather suggestion).
This turned out to be surprisingly complicated, so please see the bug and code
comments for details. I think our selection logic is pretty brittle or at least
convoluted and could stand to be simplified, but I didn't want to make large
changes here. Ideally we wouldn't treat buttons any differently on mousedown --
so we'd select them too -- and it may be possible to do that while avoiding the
problems I talk about in the bug, but I don't think it's at all worth the
complexity that seems to be required.
I added a new task to the test Daisuke created in D155812.
Comment 3•2 years ago
|
||
bugherder |
Comment 4•2 years ago
|
||
I've managed to reproduce the issue with Fx 109.0a1.
The issue is verified fixed using Fx 112.0a1 and Fx 111.0b3 on Windows 10 and Ubuntu 22.04. The input in the URLbar is no longer transformed into a search string when the result menu button is clicked. This was tested using the result menu button from the weather suggestion feature.
Description
•