Skip to content

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

Open
chunksnbits wants to merge 19 commits intohulufei:masterfrom
chunksnbits:master
Open

Pull request: Modifies event-listener setup. Adds additional options.#5
chunksnbits wants to merge 19 commits intohulufei:masterfrom
chunksnbits:master

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