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

Disable hoverClass when disabling or destroying sortable element #672

Merged
merged 2 commits into from
Mar 3, 2021

Conversation

mateuszpigula
Copy link
Contributor

Fixes #412

It adds enableHoverClass(sortableElement, false) in destroySortable method and disableSortable method.

I wanted to add tests to either hoverClass.test.ts or api.test.ts however:

  • in hoverClass I wasn't able to use sortable(ul, 'disable') properly.
  • In api.test custom event mousemove is not triggering adding the hover class (of course I added this to config).

Do not mince words please, it is my first contribution to open source ever 😄

@coveralls
Copy link

coveralls commented Feb 28, 2021

Coverage Status

Coverage increased (+0.09%) to 76.864% when pulling aba2c1b on mateuszpigula:disable-hover into d724d4a on lukasoppermann:master.

@@ -145,6 +145,9 @@ const destroySortable = function (sortableElement) {
const opts = data(sortableElement, 'opts') || {}
const items = filter(sortableElement.children, opts.items)
const handles = getHandles(items, opts.handle)
// disable adding hover class
console.log(opts)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot a console.log here, can you please delete it, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. My bad 😄

@lukasoppermann
Copy link
Owner

Hey @mateuszpigula,
first of all, thank you for your contribution and welcome to open source. 😉

This looks great and I am happy to test & merge it. Can you just quickly remove the one console.log that is still in there?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover should be disabled when sortable is disabled or destroyed
3 participants