ui-sortable icon indicating copy to clipboard operation
ui-sortable copied to clipboard

Sortable: Improved compatibility with flexbox

Open CBenni opened this issue 9 years ago • 10 comments

Added detection for flexbox into _isFloating, which improves the detection of where an item is moved to.

See https://github.com/CBenni/jquery-ui/commit/3526e7f3e2a5f18c91591874d50827d1ad9fa471 In reference to jquery-ui bug id #9344 (http://bugs.jqueryui.com/ticket/9344), which is reproducable within angular-ui/ui-sortable as well.

CBenni avatar Nov 14 '15 14:11 CBenni

:+1: Great Job! I don't think it needs any extra reviewing, maybe an example to the README and a test case. I will be happy to merge this as is, as soon as jquery/jquery-ui#1641 is merged!

Thanks for your contribution :+1:

thgreasi avatar Nov 14 '15 16:11 thgreasi

As you can probably see (in the jquery-ui PR), I am having a hard time writing a test case for this. I have a small demo that demonstrates the issue, but I have no idea if, and how, one would write a test case for that specific issue, since its simply the UI being jittery/unreliable.

If you can help me with that, ill gladly add a test case.

CBenni avatar Nov 14 '15 16:11 CBenni

I can try to write a test case for you. Can you provide me an example codepen? Ideally a fork of one of those that are available in README. On the other hand, I'm not sure whether phantomjs supports flex....

On Sat, Nov 14, 2015, 18:32 CBenni [email protected] wrote:

As you can probably see (in the jquery-ui PR), I am having a hard time writing a test case for this. I have a small demo that demonstrates the issue, but I have no idea if, and how, one would write a test case for that specific issue, since its simply the UI being jittery/unreliable.

If you can help me with that, ill gladly add a test case.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-sortable/pull/407#issuecomment-156717793 .

Thodoris Greasidis Computer, Networking & Communications Engineer

thgreasi avatar Nov 14 '15 21:11 thgreasi

Hi there. Have you been able to create an example available online to test this?

On Sat, Nov 14, 2015, 23:45 Thodoris Greasidis [email protected] wrote:

I can try to write a test case for you. Can you provide me an example codepen? Ideally a fork of one of those that are available in README. On the other hand, I'm not sure whether phantomjs supports flex....

On Sat, Nov 14, 2015, 18:32 CBenni [email protected] wrote:

As you can probably see (in the jquery-ui PR), I am having a hard time writing a test case for this. I have a small demo that demonstrates the issue, but I have no idea if, and how, one would write a test case for that specific issue, since its simply the UI being jittery/unreliable.

If you can help me with that, ill gladly add a test case.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/ui-sortable/pull/407#issuecomment-156717793 .

Thodoris Greasidis Computer, Networking & Communications Engineer

Thodoris Greasidis Computer, Networking & Communications Engineer

thgreasi avatar Nov 24 '15 16:11 thgreasi

Oh, sorry, I was very busy and forgot about this. See this plunk: http://plnkr.co/edit/UpybaNssJxQMVX30ks0B?p=preview

Trying to move certain objects is very jerky and uncontrollable (try moving 8 to where 9 is) The behaviour without tolerance: "pointer" is even worse.

The example mimics the use-case I made this change for.

CBenni avatar Nov 24 '15 18:11 CBenni

Thanks, I will check it out!

thgreasi avatar Nov 24 '15 19:11 thgreasi

Thanks for coming back to this repo. I hope I will find some time during the holidays to check this out.

Thodoris Greasidis Computer, Networking & Communications Engineer

thgreasi avatar Dec 21 '15 20:12 thgreasi

Hi, any updates? :smiley:

krema avatar Feb 25 '16 05:02 krema

The jquery-ui PR it's still open, but if this gets reported as useful by more people here, then we can merge it anyway. My only consideration is whether we should also add a chech about the direction that the flex elements are rendered. Any thoughts?

Thodoris Greasidis Computer, Networking & Communications Engineer

thgreasi avatar Feb 25 '16 06:02 thgreasi

The problem about this "fix" is that it is very hard to see if it actually fixes all the possible situations. I dont know if it breaks any situation that I had not considered, and even with this fix, the position detection is not always flawless, its a very finnicky thing to mess with. I would wait for the jquery-ui team to approve the PR on their end, honestly.

CBenni avatar Feb 29 '16 12:02 CBenni