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

feat(VDataTable): add missing event as 3rd argument #14659

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api-generator/src/locale/en/v-data-table.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"top": "Slot to add content above the table"
},
"events": {
"click:row": "Emits when a table row is clicked. This event provides 2 arguments: the first is the item data that was clicked and the second is the other related data provided by the `item` slot. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`.",
"click:row": "Emits when a table row is clicked. This event provides 3 arguments: the first is the item data that was clicked, the second is the other related data provided by the `item` slot and the third is the events. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`.",
"contextmenu:row": "Emits when a table row is right-clicked. The item for the row is included. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`.",
"dblclick:row": "Emits when a table row is double-clicked. The item for the row is included. **NOTE:** will not emit when table rows are defined through a slot such as `item` or `body`.",
"current-items": "Emits the items provided via the **items** prop, every time the internal **computedItems** is changed.",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-generator/src/maps/v-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const DataTableEvents = [
{
name: 'click:row',
source: 'v-data-table',
value: `any, ${dataString}`,
value: `any, ${dataString}, MouseEvent | KeyboardEvent`,
},
{
name: 'contextmenu:row',
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VDataTable/VDataTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export default mixins(
on: {
// TODO: for click, the first argument should be the event, and the second argument should be data,
// but this is a breaking change so it's for v3
click: () => this.$emit('click:row', item, data),
click: (event: MouseEvent | KeyboardEvent) => this.$emit('click:row', item, data, event),
contextmenu: (event: MouseEvent) => this.$emit('contextmenu:row', event, data),
dblclick: (event: MouseEvent) => this.$emit('dblclick:row', event, data),
},
Expand Down