From 3e04d6e4cd82a75f9b0ac2f1f30431726e1c4bc9 Mon Sep 17 00:00:00 2001 From: SebinSong Date: Wed, 5 Jun 2024 09:30:33 +1200 Subject: [PATCH] fix the bug re the link not bringing up the in-app panel --- frontend/views/containers/chatroom/MessageBase.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/views/containers/chatroom/MessageBase.vue b/frontend/views/containers/chatroom/MessageBase.vue index 71b150432..b394dcfde 100644 --- a/frontend/views/containers/chatroom/MessageBase.vue +++ b/frontend/views/containers/chatroom/MessageBase.vue @@ -202,10 +202,12 @@ export default ({ this.$refs.messageAction.$refs.menu.handleTrigger() }, longPressHandler (e) { - const targetEl = e.target - if (targetEl.matches('a.link[href]')) { - const url = targetEl.getAttribute('href') + const wrappingLinkTag = e.target.closest('a.link[href]') + + if (wrappingLinkTag) { + const url = wrappingLinkTag.getAttribute('href') sbp('okTurtles.events/emit', OPEN_TOUCH_LINK_HELPER, url) + e?.preventDefault() } else { this.openMenu() }