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

Pull request: Modifies event-listener setup. Adds additional options. #5

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

chunksnbits
Copy link

Hi,

I loved the mixin but since I had a couple of issues getting the mixin to work with dynamic concent, so I made a couple of changes on a fork. Maybe this is also something that is interesting for you (note: my fork was initially based on: https://github.com/ganeshp0001/react-sortable-mixin). The following changes were made:

  • Move event handling to list-mixin, i.e., makes it easier to handle dynamic content and minimizes the amount of event-listeners attached (one on document vs. n for every child), which should also improve performance for larger lists
  • Adds option to limit movement to x- / y- axis
  • Adds option to specify a class-name to be added to the dragged item
  • Adds option to specify a class-name to be added to the placeholder
  • Adds option to specify the z-Index to be set for the dragged item

I have one issue, I am currently not happy with. Maybe you have an idea how to solve this better:

  • Right now I register the list-items using their reactid. This does not seem to be the best solution, but I found no better way to communicate between the components without demanding additional markup / attribute for using them. This also causes the tests to fail right now.

Have a look and if you are interested or require additional changes, feel free to contact me.

Greetings,
Daniel

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.

3 participants