Skip to content

Commit 499595d

Browse files
committed
Prevents keyboard event bubbling in card component
Adds event.stopPropagation() calls to keyboard event handlers to prevent events from bubbling up to parent elements when the card handles Enter, Space, or other key interactions.
1 parent 3407134 commit 499595d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

client/src/components/Common/GCard.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,10 @@ const allowedTitleLines = computed(() => props.titleNLines);
289289
290290
function onKeyDown(event: KeyboardEvent) {
291291
if ((props.clickable && event.key === "Enter") || event.key === " ") {
292+
event.stopPropagation();
292293
emit("click", event);
293294
} else if (props.clickable) {
295+
event.stopPropagation();
294296
emit("keydown", event);
295297
}
296298
}

0 commit comments

Comments
 (0)