Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] v-datatable click:row event should not fire event when selecting the default checkbox(v-datatable set show-select prop) #16936

Closed
XieWeiJie opened this issue Mar 17, 2023 · 1 comment
Assignees
Labels
C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected

Comments

@XieWeiJie
Copy link

Problem to solve

 <v-data-table
      show-select
      :modelValue="selected"
      @update:modelValue="onSelectedChange"
      @click:row="onRowClick"
    >
...
<script setup>
const selected=ref([...])
function onSelectedChange(args){
   selected.value = args
}
function onRowClick(e, { item }){
   const currentRowReactive = item.value
   selected.value = []
   selected.value.push(currentRowReactive)
}
</script>

I set the show select property in the v-data table component, and the component will render a check box by default.
My requirement is that when the mouse clicks on a check box, the table supports multiple selections. When clicking on an area other than the check box, only that piece of data is selected, and other selected rows are deselected

Proposed solution

Because only clicking the check box will trigger the click: row event, I cannot meet this requirement.

@davidstackio
Copy link

I'm having this same issue too. This might be a bug report, rather than a feature request since v-data-table is still in labs.

@nekosaur nekosaur changed the title [Feature Request] v-datatable click:row event should not fire event when selecting the default checkbox(v-datatable set show-select prop) [Bug Report] v-datatable click:row event should not fire event when selecting the default checkbox(v-datatable set show-select prop) Mar 25, 2023
@nekosaur nekosaur added T: bug Functionality that does not work as intended/expected C: VDataTable VDatatable and removed S: triage labels Mar 25, 2023
@nekosaur nekosaur self-assigned this Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDataTable VDatatable T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

3 participants