Page MenuHomePhabricator

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

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


Reported upstream: (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 added a subscriber: Tgr.
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 / ; 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: - spoiler: super nice video there.

To cross info a bit I've linked this task from and added #affects-wikimedia there.