-
Notifications
You must be signed in to change notification settings - Fork 33
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
Inform the developer that they've missed draggable="true"
on the drag handle
#18
Comments
Hi! Thank you for your interest in the addon and your desire to contribute. I agree that there is room for improvement.
We're relying on HTML5 drag'n'drop capabilities, so the attribute is a requirement.
Sounds like moving the source of confusion to another place rather than removing it. :)
I'm in favor of either of these options, but there's a catch. Currently the user is able to control {{#drag-sort-list
items = myArray
dragEndAction = (action 'dragEnd')
draggingEnabled = isDragonSleeping
handle = ".my-handle"
as |item|
}}
<span class="my-handle" draggable={{isDragonSleeping}}></span>
{{item.name}}
{{/drag-sort-list}} If we stop relying on the user setting the I can see two options for this:
{{#drag-sort-list
items = myArray
dragEndAction = (action 'dragEnd')
draggingEnabled = isDragonSleeping
as |item handle|
}}
{{component handle tagName="span"}}
{{item.name}}
{{/drag-sort-list}} What do you think about the latter? |
I've just spent more time than I'd care to admit debugging an issue which I initially thought was caused by attempting to use
ember-drag-sort
within anember-paper
dialog, as I'd been happily using it outside the dialog, but it didn't want to work at all within it. It turned out that I'd misseddraggable="true"
on my drag handle - but there was no indication that this was the case (other than nothing being draggable).It would be ideal if either:
draggable="true"
(though I'm not sure how feasible that would be);draggable="true"
set on it if missing;ember-drag-sort
raised some sort of warning (at least in dev) if a handle selector is provided but the handle doesn't havedraggable="true"
; orhandle
selector was ignored if the handle didn't havedraggable="true"
, perhaps by adding an attribute selector to thehandle
selector in thedrag-sort-item
's$handle
computed property and using$handle
instead ofhandle
in thedraggable
computed property.If it'll help, I can look at submitting a PR - just let me know what the preferred approach is.
The text was updated successfully, but these errors were encountered: