2022-01-20 19:03:48 +00:00
|
|
|
export function ignoreClick (e) {
|
|
|
|
return e.target.onclick || // the target has a click handler
|
|
|
|
// the target has an interactive parent
|
2023-01-12 23:53:09 +00:00
|
|
|
e.target.matches(':where(.upvoteParent, .pointer, form, textarea, button, a, input) :scope') ||
|
2022-01-20 19:03:48 +00:00
|
|
|
// the target is an interactive element
|
|
|
|
['TEXTAREA', 'BUTTON', 'A', 'INPUT', 'FORM'].includes(e.target.tagName.toUpperCase()) ||
|
|
|
|
// the target is an interactive element
|
2023-01-12 23:53:09 +00:00
|
|
|
e.target.class === 'upvoteParent' || e.target.class === 'pointer'
|
2022-01-20 19:03:48 +00:00
|
|
|
}
|