Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10731 closed bug (patcheswelcome)

Draggable not respecting axis:"x" within table

Reported by: tiptop Owned by:
Priority: minor Milestone: none
Component: ui.draggable Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:

Description

I have a large table that contains cells with up to several items each. I want to support dragging such items between cells in their current rows. This works most of the time but for some specific items it doesn't. I have isolated a case where the problem occurs e.g both with Firefox 34.0 (on OS X) and with Safari 8.0.2: drag "2/2" to the left and it is immediately shown in the 1st instead of the 2nd row. It is apparently "only" a display problem, a drop would reach the right cell. The problem apparently disappears when I remove the rule for selector * the CSS.

Here is the HTML/CSS on JSFiddle: http://jsfiddle.net/xam3nsr0/

Is this a feature or a bug? Is there a better workaround than not changing fonts?

Change History (4)

comment:1 Changed 8 years ago by Scott González

Resolution: patcheswelcome
Status: newclosed

This is caused by the snap option, not by the axis option. Since this behavior has existed for years and we're removing the snap options in the ongoing rewrite, I don't expect this to be fixed. However, if someone would like to track down the problem and send a pull request, we can review it.

comment:2 in reply to:  1 ; Changed 8 years ago by tiptop

Thanks for the quick follow-up. Out of curiosity: is there a write-up that explains why snap options will be removed and what, if anything, replaces them.

comment:3 in reply to:  2 ; Changed 8 years ago by Scott González

Replying to tiptop:

Out of curiosity: is there a write-up that explains why snap options will be removed

Not yet, but the gist of it is that there are way too many ways to limit movement and they often conflict with each other.

and what, if anything, replaces them.

Custom positioning via the drag event. This has existed for as long as I can remember, but unfortunately it hasn't been documented yet: https://github.com/jquery/api.jqueryui.com/issues/221 This allows developers to build whatever extensions they want, including rebuilding the snap options.

comment:4 in reply to:  3 Changed 8 years ago by tiptop

Thanks again. I'll try to refactor my code accordingly.

Note: See TracTickets for help on using tickets.