From 09efcb48a4c1e22c0cef467adc9cfcefe2818c0d Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 23 Jul 2019 15:43:03 -0400 Subject: [PATCH] try to use the closest a tag as target --- src/components/status/status.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index faefb80e..f87a2413 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -323,10 +323,8 @@ const Status = { }, linkClicked (event) { let { target } = event - if (target.tagName === 'SPAN') { - target = target.parentNode - } - if (target.tagName === 'A') { + target = target.tagName === 'A' ? target : target.closest('a') + if (target) { if (target.className.match(/mention/)) { const href = target.href const attn = this.status.attentions.find(attn => mentionMatchesUrl(attn, href))