forked from Mirrors/gomuks
web/timeline: fix context menu disable condition
This commit is contained in:
parent
8a88b6d3d8
commit
daa0ce722d
1 changed files with 3 additions and 2 deletions
|
@ -76,10 +76,11 @@ const TimelineEvent = ({ evt, prevEvt, disableMenu }: TimelineEventProps) => {
|
|||
const openModal = use(ModalContext)
|
||||
const [forceContextMenuOpen, setForceContextMenuOpen] = useState(false)
|
||||
const onContextMenu = useCallback((mouseEvt: React.MouseEvent) => {
|
||||
const targetElem = mouseEvt.target as HTMLElement
|
||||
if (
|
||||
!roomCtx.store.preferences.message_context_menu
|
||||
|| mouseEvt.currentTarget.tagName === "A"
|
||||
|| mouseEvt.currentTarget.tagName === "IMG"
|
||||
|| targetElem.tagName === "A"
|
||||
|| targetElem.tagName === "IMG"
|
||||
|| window.getSelection()?.type === "Range"
|
||||
) {
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue