From d2f5311400350b9686541af3a7c4aa20de0883e0 Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Wed, 18 Jun 2025 23:51:23 +0200 Subject: [PATCH] fix: Disable custom context menu on img tags (#11762) # Pull Request Template ## Description Fixes #11761. See the issue for the details. ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality not to work as expected) - [ ] This change requires a documentation update ## How Has This Been Tested? I deployed a modified version of Chatwoot with this patch and tested. ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation (not applicable) - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works (not sure how to do this) - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published in downstream modules --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> --- app/javascript/dashboard/components-next/message/Message.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/dashboard/components-next/message/Message.vue b/app/javascript/dashboard/components-next/message/Message.vue index 98323f79a..28776a8d9 100644 --- a/app/javascript/dashboard/components-next/message/Message.vue +++ b/app/javascript/dashboard/components-next/message/Message.vue @@ -379,7 +379,7 @@ const shouldRenderMessage = computed(() => { function openContextMenu(e) { const shouldSkipContextMenu = e.target?.classList.contains('skip-context-menu') || - e.target?.tagName.toLowerCase() === 'a'; + ['a', 'img'].includes(e.target?.tagName.toLowerCase()); if (shouldSkipContextMenu || getSelection().toString()) { return; }