prevent selection from causing clicks on clickToContext

This commit is contained in:
keyan 2023-05-18 13:36:01 -05:00
parent 87e86526f8
commit e946f3c434
1 changed files with 3 additions and 1 deletions

View File

@ -5,5 +5,7 @@ export function ignoreClick (e) {
// the target is an interactive element // the target is an interactive element
['TEXTAREA', 'BUTTON', 'A', 'INPUT', 'FORM'].includes(e.target.tagName.toUpperCase()) || ['TEXTAREA', 'BUTTON', 'A', 'INPUT', 'FORM'].includes(e.target.tagName.toUpperCase()) ||
// the target is an interactive element // 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()
} }