Skip to content

Commit

Permalink
feat: add skipHover prop to deactive the hover detection (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
gans-groover committed Oct 10, 2022
1 parent 59f3f1b commit b613318
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/RecycleScroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
:key="view.nr.id"
:style="ready ? { transform: `translate${direction === 'vertical' ? 'Y' : 'X'}(${view.position}px)` } : null"
class="vue-recycle-scroller__item-view"
:class="{ hover: hoverKey === view.nr.key }"
@mouseenter="hoverKey = view.nr.key"
@mouseleave="hoverKey = null"
:class="{ hover: !skipHover && hoverKey === view.nr.key }"
@mouseenter="!skipHover && (hoverKey = view.nr.key)"
@mouseleave="!skipHover && (hoverKey = null)"
>
<slot
:item="view.item"
Expand Down Expand Up @@ -118,6 +118,11 @@ export default {
type: Boolean,
default: false,
},
skipHover: {
type: Boolean,
default: false,
},
},
data () {
Expand Down

0 comments on commit b613318

Please sign in to comment.