Page MenuHomePhabricator

handleLinkClick breaks navigation for links with sub-elements
Closed, ResolvedPublic

Description

When a link has a sub-element, and you click the sub-element, it will navigate to 'undefined'.

This is because event.target is what you actually clicked. If that is a sub-element, it won't have the href.

Reported by Jake Orlowitz; affects The Wikipedia Adventure which uses a <big> sub-element.


Version: master
Severity: normal

Details

Reference
bz71494

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:52 AM
bzimport set Reference to bz71494.
Ocaasi added a comment.Oct 1 2014, 2:19 AM

Is the only thing needed to do to avoid this to remove <big> tags from the name? ...For TWA that is doable as <big> is only being used to make an arrow larger and serves little function. (So it's a bug, but perhaps lower priority).

(In reply to Matthew Flaschen from comment #0)

When a link has a sub-element, and you click the sub-element, it will
navigate to 'undefined'.
This is because event.target is what you actually clicked. If that is a
sub-element, it won't have the href.
Reported by Jake Orlowitz; affects The Wikipedia Adventure which uses a
<big> sub-element.

(In reply to Ocaasi from comment #1)

Is the only thing needed to do to avoid this to remove <big> tags from the
name? ...For TWA that is doable as <big> is only being used to make an arrow
larger and serves little function. (So it's a bug, but perhaps lower
priority).

That would work around the bug. However, I'm going to fix it today anyway (deploy time TBD).

gerritadmin wrote:

Change 164026 had a related patch set uploaded by Mattflaschen:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164026

gerritadmin wrote:

Change 164026 merged by jenkins-bot:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164026

gerritadmin wrote:

Change 164153 had a related patch set uploaded by Mattflaschen:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164153

gerritadmin wrote:

Change 164156 had a related patch set uploaded by Mattflaschen:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164156

gerritadmin wrote:

Change 164153 merged by jenkins-bot:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164153

gerritadmin wrote:

Change 164156 merged by jenkins-bot:
FIx handleLinkClick to handle sub-elements within links

https://gerrit.wikimedia.org/r/164156

Deployed early to all WMF wikis.