Page MenuHomePhabricator

Unable to open the link in new tab using right click
Closed, ResolvedPublic

Description

The scripts overwrite the link URL for a tag, therefore the user is unable to open the link in a new tab through right-click

image.png (432×1 px, 139 KB)

This is useful if you are using a touchable desktop, and I use mouse but don't want to show the preview popup on left-click.

Event Timeline

SBisson triaged this task as Medium priority.
SBisson edited projects, added Inuka-Team (Kanban); removed Inuka-Team.
SBisson moved this task from Backlog to Code Review on the Inuka-Team (Kanban) board.
SBisson added a subscriber: SBisson.

Not sure if this is related but when I am clicking on top of "Lombok" preview link then it also opens the Wikipedia article. I think expected behavior is that clicking shouldn't work on words which are highlighted as preview. Maybe this is the problem just with "Lombok" as I didn't see that happening with "Gili Meno" one.

I think it's important not to mess with standard web behavior unless we absolutely have to. On desktop, preview is triggered by hover so we leave the click event alone. Users are free to click, cmd/ctlr-click, or right-click like they would do on any other links. On touch devices, we have to prevent the tap from navigating.

Thanks Stephane, this make sense. Shall we allow click event for other preview links as well? Currently, only "Lombok" is responding to click, right-click and opening Wikipedia article.

Screen Shot 2021-08-26 at 11.35.07 AM.png (910×1 px, 305 KB)

Note that this feature only apply to the <a href=""/> tag with detectLinks: true (auto detect feature),

the custom form <span class="wmf-wp-with-preview" data-wikipedia-preview="">Gili Meno</span> remains the span form

Thanks @hueitan , to make sure I understand it correctly. If a site has a WordPress plugin installed and using a custom form, then click/right-click won't work as it uses <span> tag? Happy to chat more about it during our daily.

using a custom form, then click/right-click won't work as it uses <span> tag

Yes, you are right.

Alright, based on our discussion, we are moving this to product signoff. We will return to it once we have enough data to support click/right-click for span tag.