Page MenuHomePhabricator

Phabricator search dropdown results should open in new tab on middle-click
Closed, ResolvedPublic

Assigned To
Authored By
Tgr
Dec 5 2014, 12:28 AM
Referenced Files
None
Tokens
"Party Time" token, awarded by Tacsipacsi."Love" token, awarded by valerio.bozzolan."Like" token, awarded by Ciencia_Al_Poder.

Description

Reported upstream: https://secure.phabricator.com/T6700 (resolved as duplicate of Make various <div /> elements in menus act like <a /> elements when middle-clicked or right-clicked (Open, Wishlist)

Compare the behavior of the dropdown of the top search bar in Phabricator with e.g. the search box in the MediaWiki Vector skin. There, if you get several interesting search results in the dropdown, you can just middle-click them all to open them in new tabs (or right-click and select "Open in new window", or do any of the other things one can do with a link). Phabricator just navigates away in the current tab on any kind of click.

Event Timeline

Tgr raised the priority of this task from to Needs Triage.
Tgr updated the task description. (Show Details)
Tgr added a project: Phabricator (Upstream).
Tgr changed Security from none to None.
Tgr subscribed.
Aklapper triaged this task as Lowest priority.Dec 5 2014, 12:30 AM

Interesting. I'm happy to report this upstream, and I think the proposal will be better received if we provide a link to our code providing that functionality. Can someone provide the right link/pointer, please?

For MediaWiki that was T19808 / https://gerrit.wikimedia.org/r/#/c/23674/ ; in general, you need to make sure, that the search dropdown items are wrapped in <a> tags pointing to the right location, and that the click handler does not catch non-left-clicks or left clicks with a modifier key. The code we used in MediaViewer for that is

if ( e.altKey || e.shiftKey || e.ctrlKey || e.metaKey || e.button ) { /* let the browser handle the click * / }

although it will be a bit more tricky if you want to be handle old IE versions correctly.

Tgr renamed this task from Search dropdown results should open in new tab on middle-click to Phabricator search dropdown results should open in new tab on middle-click.Jan 30 2023, 7:14 AM

Fixed, maybe while migrating to Phorge.

You're welcome! Yeah that was really frustrating :)

Just to clarify that this was the exact patch: https://we.phorge.it/D25069 - spoiler: super nice video there.

To cross info a bit I've linked this task from https://we.phorge.it/T15149 and added #affects-wikimedia there.

\o/