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

dragover event cancelling #210

Open
scriby opened this issue Jan 7, 2015 · 10 comments
Open

dragover event cancelling #210

scriby opened this issue Jan 7, 2015 · 10 comments
Labels
enhancement Quality of life changes to existing features

Comments

@scriby
Copy link

scriby commented Jan 7, 2015

I have a really strange setup and the built-in scrolling in Sortable doesn't work for me (it's a case far outside of what you'd want to support).

I was going to implement my own scroll handler, sort of similar to the built-in one, but noticed that the dragover event is getting cancelled: https://github.com/RubaXa/Sortable/blob/26f148ce4456fd21e5c149c1c5d637ebc116034f/Sortable.js#L461

I am wondering if that has to get cancelled there. And if so, would you consider exposing an event or something in Sortable I could hook into as an alternative.

Thanks,

Chris

@scriby
Copy link
Author

scriby commented Jan 12, 2015

Did you have a chance to take a look at this?

@RubaXa
Copy link
Collaborator

RubaXa commented Jan 12, 2015

I do not understand what you want from me? Sortable fully captures drag-events and processes them.
If you have a problem with it, create an example on jsbin.com

@scriby
Copy link
Author

scriby commented Jan 12, 2015

http://jsfiddle.net/aL8wLbgg/

The dragover event handler on the document never gets called because Sortable is not allowing the event to bubble. I need to implement my own scroll handler, so I need to be able to catch that event.

If I comment out the code in Sortable that I highlighted in my first comment on this issue, then I am able to handle the event directly. However, I don't know if there is a reason the event is prevented from bubbling. If so, I was hoping Sortable could expose another event to make it possible to write a custom scroll handler.

Thanks,

Chris

@RubaXa
Copy link
Collaborator

RubaXa commented Jan 12, 2015

Alas, if I remove stopPropagation, then will break backward compatibility: #166 (comment)

But possible to add options:

eventBubbles: {
   dragover: boolean,
   drop: boolean
}

@scriby
Copy link
Author

scriby commented Jan 12, 2015

That would be great!

@RubaXa
Copy link
Collaborator

RubaXa commented Jan 12, 2015

Try issue-210 branch
Default options:

  • dropBubble: false
  • dragoverBubble: false

@scriby
Copy link
Author

scriby commented Jan 12, 2015

I tested it out and it does what I need. Thanks!

@RubaXa
Copy link
Collaborator

RubaXa commented Jan 12, 2015

Good.

@RubaXa RubaXa added the enhancement Quality of life changes to existing features label Jan 13, 2015
@scriby
Copy link
Author

scriby commented Jan 15, 2015

Do you have any plans for releasing this change?

@RubaXa
Copy link
Collaborator

RubaXa commented Jan 15, 2015

Yes, changes already in the dev-branch.

RubaXa added a commit that referenced this issue Jan 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Quality of life changes to existing features
Projects
None yet
Development

No branches or pull requests

2 participants