+
{
- e.preventDefault()
- e.stopPropagation()
if (!item || voteLock) return
// we can't tip ourselves
@@ -198,8 +196,6 @@ export default function UpVote ({ item, className }) {
onShortPress={
me
? async (e) => {
- e.preventDefault()
- e.stopPropagation()
if (!item || voteLock) return
// we can't tip ourselves
@@ -256,9 +252,6 @@ export default function UpVote ({ item, className }) {
filter: `drop-shadow(0 0 6px ${color}90)`
}
: undefined}
- onClick={e => {
- e.stopPropagation()
- }}
/>
diff --git a/lib/clicks.js b/lib/clicks.js
new file mode 100644
index 00000000..02432310
--- /dev/null
+++ b/lib/clicks.js
@@ -0,0 +1,9 @@
+export function ignoreClick (e) {
+ return e.target.onclick || // the target has a click handler
+ // the target has an interactive parent
+ e.target.matches(':where(.upvoteParent, form, textarea, button, a, input) :scope') ||
+ // 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'
+}