Skip to content

Commit

Permalink
web/timeline: fix clicking spoilers and summaries on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jan 23, 2025
1 parent ce72841 commit 15238b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/ui/timeline/TimelineEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ const TimelineEvent = ({ evt, prevEvt, disableMenu, smallReplies, isFocused }: T
if (
targetElem.tagName === "A"
|| targetElem.tagName === "IMG"
|| targetElem.tagName === "VIDEO"
|| targetElem.tagName === "SUMMARY"
) {
return
}
Expand Down
2 changes: 2 additions & 0 deletions web/src/ui/timeline/content/TextMessageBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ const onClickHTML = (evt: React.MouseEvent<HTMLDivElement>) => {
} else if (targetElem.closest?.("span.hicli-spoiler")?.classList.toggle("spoiler-revealed")) {
// When unspoilering, don't trigger links and other clickables inside the spoiler
evt.preventDefault()
evt.stopPropagation()
} else if (isAnchorElement(targetElem) && targetElem.href.startsWith("matrix:")) {
onClickMatrixURI(targetElem.href)
evt.preventDefault()
evt.stopPropagation()
}
}

Expand Down

0 comments on commit 15238b6

Please sign in to comment.