Skip to content

Commit

Permalink
Correct applying hover classes
Browse files Browse the repository at this point in the history
In case when sortable elements has child's,
hover classes don't append correctly.

Fixes: #504
  • Loading branch information
aksenovdev committed May 10, 2021
1 parent 5cb9f63 commit 83cc946
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hoverClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export default (sortableContainer: sortable, enable: boolean) => {
// check of no mouse button was pressed when mousemove started == no drag
if (event.buttons === 0) {
filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(item => {
if (item !== event.target) {
item.classList.remove(...hoverClasses)
} else {
if (item === event.target || item.contains(event.target)) {
item.classList.add(...hoverClasses)
} else {
item.classList.remove(...hoverClasses)
}
})
}
Expand Down

0 comments on commit 83cc946

Please sign in to comment.