I have a data table containing clickable rows. All is working well, I encountered one problem. If I want to highlight text on the row, the click event
is triggered. The only thing I found that could help is the .exact modifier.
Hoping it will ignore the click handler if text is highlighted. But the click event
is still triggered.
My Question: Is there a way I can highlight text on an item without triggering the click event.
Expected Result: Using @click.exact
wont fire click event when highlighting text
Actual Result: Click event is fired when highlighting text, event using @click.exact
Side Note: It manages to hightlight the text, but as soon as you let the mouse button go, it triggers the click event.
<v-data-table
v-show="model.id && !editMode"
:headers="bagHeaders"
:items="bags"
class="elevation-1"
item-key="id"
:loading="bagsStatus.loading"
:pagination.sync="pagination"
>
<template slot="items" slot-scope="props">
<tr @click.exact="onBagClick(props.item.id)">
<td class="text-xs-left" v-for="header in bagHeaders" :key="header.id">{{ formatColumn(header, props.item) }}</td>
</tr>
</template>
</v-data-table>
Edit:
Other Attempts: @click.prevent
also not working
Best work around so far: https://codepen.io/anon/pen/YBNLLy