teijo / jquery-bracket

jQuery Bracket library for organizing single and double elimination tournaments
http://aropupu.fi/bracket/
MIT License
482 stars 253 forks source link

Compatibility with dragscroll plugin #108

Open kpagcha opened 7 years ago

kpagcha commented 7 years ago

I am loading a bracket in a div that takes the left half of the main container. To explore the bracket, I am using the dragscroll plugin. Dragging horizontally moves the bracket as expected.

Here is a working example.

The issue comes when trying this on mobile. Dragging the brackets just won't work, I cannot figure out why so I am here to hopefully get some help. I know this is not a issue directly related to the bracket plugin, but I have a suspicion that that dragscroll does not work on mobile because of the DOM generated by the plugin, so that makes it related to it.

teijo commented 7 years ago

Does it make any difference if you wrap the bracket container instead of using the dragscroll onto the container itself?

Now:

<div id="bracket" class="col-md-6 dragscroll" style="overflow: hidden;"></div>

Test:

<div class="col-md-6 dragscroll" style="overflow: hidden;">
  <div id="bracket"></div>
</div>

Or try applying dragscroll onto the container/wrapper after the bracket is rendered once? My assumption is that the class will be sniffed by a script that adds some listeners to that element. The bracket doesn't have size until it's rendered once, which might cause problems if the drag script expects that at "hook-time".

kpagcha commented 7 years ago

Yeah I've tried that but it really didn't work. Check it out.

As of applying the dragscroll after the bracket is rendered, yeah, I thought of that; you can reapply the dragscroll pluggin by calling dragscroll.reset() but it did not help either. And it doesn't make sense either, because the dragscroll is actually working (so the functionality is being applied to the rendered elements: the bracket), it just does not work on mobile