Skip to content

feat(table): Add row-unhovered event #1874

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

Merged
merged 3 commits into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/components/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@
}
]
},
{
"event": "row-unhovered",
"description": "Emitted when a row is unhovered.",
"args": [
{
"arg": "item",
"description": "Item data of the row being unhovered."
},
{
"arg": "index",
"description": "Index of the row being unhovered."
},
{
"arg": "event",
"description": "Native event object."
}
]
},
{
"event": "head-clicked",
"description": "Emitted when a header or footer cell is clicked.",
Expand Down
10 changes: 10 additions & 0 deletions src/components/table/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ export default {
},
mouseenter: evt => {
this.rowHovered(evt, item, rowIndex)
},
mouseleave: evt => {
this.rowUnhovered(evt, item, rowIndex)
}
}
},
Expand Down Expand Up @@ -946,6 +949,13 @@ export default {
}
this.$emit('row-hovered', item, index, e)
},
rowUnhovered (e, item, index) {
if (this.stopIfBusy(e)) {
// If table is busy (via provider) then don't propagate
return
}
this.$emit('row-unhovered', item, index, e)
},
rowContextmenu (e, item, index) {
if (this.stopIfBusy(e)) {
// If table is busy (via provider) then don't propagate
Expand Down