From e946f3c43418241d5eeb97e19a5697af888c4adc Mon Sep 17 00:00:00 2001 From: keyan Date: Thu, 18 May 2023 13:36:01 -0500 Subject: [PATCH] prevent selection from causing clicks on clickToContext --- lib/clicks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/clicks.js b/lib/clicks.js index 0aaec099..41046677 100644 --- a/lib/clicks.js +++ b/lib/clicks.js @@ -5,5 +5,7 @@ export function ignoreClick (e) { // the target is an interactive element ['TEXTAREA', 'BUTTON', 'A', 'INPUT', 'FORM'].includes(e.target.tagName.toUpperCase()) || // the target is an interactive element - e.target.class === 'upvoteParent' || e.target.class === 'pointer' + e.target.class === 'upvoteParent' || e.target.class === 'pointer' || + // the click is caused by a selection + window.getSelection()?.toString() }