From 4ed63fe58d640bd3f63a6d49a70c4959b34e0c09 Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 8 May 2021 20:08:12 +0200 Subject: [PATCH] stop event propagation on close text button --- src/components/text/TextCard.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/text/TextCard.vue b/src/components/text/TextCard.vue index 1ec0a0a..dd3bc94 100644 --- a/src/components/text/TextCard.vue +++ b/src/components/text/TextCard.vue @@ -5,7 +5,7 @@ - + @@ -54,6 +54,18 @@ export default { props: { children: { type: Array, default: null } + }, + + methods: { + onChildOpen (_, id, childId) { + this.$emit('open', id, childId) + }, + + onSelfClose (e, id) { + // stop the click event propagation to avoid other listeners to interact with a soon to be deleted element. + e.stopPropagation() + this.$emit('close', id) + } } }