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

Conditionally changing ability to drag with dragHandle set does not work #128

Open
hbrysiewicz opened this issue Jun 5, 2018 · 0 comments

Comments

@hbrysiewicz
Copy link

Since the drag handle functionality is configured in the didInsertElement hook (https://github.com/mharris717/ember-drag-drop/blob/master/addon/components/draggable-object.js#L27-L43) it is not possible to initially hide the handle, and then show it based on a selected state in the application.

For example, in my case, I have 3 columns, each a list. I only want the right column to be sortable when an item in the left column has been selected. When selecting from a left column, it drills down items in the adjacent right column.

Moving the logic in the didInsertElement hook instead to the didReceiveAttrs hook (with some added logic to ensure handlers aren't added when they already exist) fixes this problem as the binding would happen when state changed and the handle now appeared within the component.

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

No branches or pull requests

1 participant