From 9e955a23d529d3270cc5fd75e77d438236d1c66a Mon Sep 17 00:00:00 2001 From: Chris Patuzzo Date: Mon, 22 Jul 2024 17:03:56 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20the=20player=E2=80=99s=20fuzzy=20matching?= =?UTF-8?q?=20detecting=20segments=20inside=20its=20own=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We show the content item’s title inside the ‘large’ playerStyle which the player was mistaking for a hoverable segment. --- src/helpers/chooseSegmentPerPlayer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/chooseSegmentPerPlayer.ts b/src/helpers/chooseSegmentPerPlayer.ts index 49bc6933..11c22db2 100644 --- a/src/helpers/chooseSegmentPerPlayer.ts +++ b/src/helpers/chooseSegmentPerPlayer.ts @@ -63,6 +63,9 @@ const shouldNotRespondToHoverOrClick = (node) => { const isEditable = nodeName === "input" || nodeName === "textarea" || node.isContentEditable; if (isEditable) { return true; } + + const isPlayer = !!node.closest(".beyondwords-player"); + if (isPlayer) { return true; } }; const chooseSegmentBy = (matchFnFn, node, players, segmentPerPlayer, playersRemaining) => {