Skip to content

Commit

Permalink
Fix click.stop not working on interactive elements
Browse files Browse the repository at this point in the history
rendered within the card via its slots.
  • Loading branch information
MisRob committed Sep 11, 2024
1 parent 9f49f4b commit 2125386
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/KCard/index.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<template>

<!-- see trackInputModality for [data-focus=true] -->
<!--
do not use @onmouseup but rather @click
to allow for @click.stop on buttons and similar
rendered within a card via its slots -->
<li
tabindex="0"
data-focus="true"
:class="['k-card', $computedClass(coreOutlineFocus)]"
@focus="onFocus"
@mouseenter="onHover"
@mousedown="onMouseDown"
@mouseup="onMouseUp"
@click="onClick"
@keyup.enter="onEnter"
>
<div
Expand All @@ -28,7 +32,7 @@
This is because <li> is supposed to take care of it.
Furthemore, together with 'draggable' disabled, it ensures
that text selection works on the title text.
See the custom click implementation in 'onMouseUp'.
See the custom click implementation in 'onClick'.
-->
<router-link
tabindex="-1"
Expand Down Expand Up @@ -371,6 +375,7 @@
},
},
mounted() {
console.log('TEST');
if (!this.$slots.title && !this.title) {
console.error(`[KCard] provide title via 'title' slot or prop`);
}
Expand All @@ -391,7 +396,7 @@
onMouseDown() {
this.mouseDownTime = new Date().getTime();
},
onMouseUp() {
onClick() {
const mouseUpTime = new Date().getTime();
// Make textual content selectable within the whole clickable card area.
//
Expand Down

0 comments on commit 2125386

Please sign in to comment.