Skip to main content

Search and Top Navigation

#9028 closed bug (notabug)

Opened January 30, 2013 03:55AM UTC

Closed February 04, 2013 02:31PM UTC

Last modified February 05, 2013 01:41PM UTC

When cancelHelperRemoval is true, the placeholder is not removed

Reported by: linus.yan87 Owned by: linus.yan87
Priority: minor Milestone: none
Component: ui.sortable Version: 1.9.2
Keywords: Cc:
Blocked by: Blocking:
Description

When cancelHelperRemoval is true, _clear() just return without removing the placeholder.

Why not put placeholder removal statement forward before cancelHelperRemoval condition? I don't think helper is related with placeholder.

Attachments (0)
Change History (16)

Changed January 30, 2013 04:13AM UTC by tj.vantoll comment:1

owner: → linus.yan87
status: newpending

Hi linus.yan87, thanks for taking the time to contribute to the jQuery UI project.

Is this creating any issues for you? If so we'll need a reduced test case that shows it, you can use this to get started http://jsfiddle.net/tj_vantoll/kY7FA/.

Changed January 30, 2013 01:27PM UTC by tj.vantoll comment:2

Sorry, should have given you a link to the sortable test case - http://jsfiddle.net/tj_vantoll/wjxe4/.

Changed January 31, 2013 06:53AM UTC by linus.yan87 comment:3

_comment0: Hi tj.vantoll, \ \ I try to clarify the problem in jsfiddle: http://jsfiddle.net/tj_vantoll/wjxe4/. But I suddenly met a strange problem. I can't get the sortable object. $('#sortable').data('sortable') return undefined. Do you know why?1359615288451753
status: pendingnew

Changed January 31, 2013 06:54AM UTC by linus.yan87 comment:4

Replying to [comment:2 tj.vantoll]:

Sorry, should have given you a link to the sortable test case - http://jsfiddle.net/tj_vantoll/wjxe4/.

Hi tj.vantoll,

I try to clarify the problem in jsfiddle: http://jsfiddle.net/tj_vantoll/wjxe4/. But I suddenly met a strange problem. I can't get the sortable object. $('#sortable').data('sortable') return undefined. Do you know why?

Changed January 31, 2013 08:46AM UTC by linus.yan87 comment:5

Replying to [comment:2 tj.vantoll]:

Sorry, should have given you a link to the sortable test case - http://jsfiddle.net/tj_vantoll/wjxe4/.

In fact, I used a additional div as the helper element. But I don't need to remove it when sorting has stopped. So I set the cancelHelperRemoval property to true before sorting stopped. Then, the helper is not removed(this is what I need), but the placeholder is not removed(not I need), too. And it will create a new one every time you drag the items.

Changed January 31, 2013 08:49AM UTC by linus.yan87 comment:6

_comment0: Replying to [comment:3 linus.yan87]: \ \ I'm not sure what happened in jsFiddle. But we can't get the sortable object with $('#sortable').data('sortable'). My chosen framework is jQuery 1.9.0 and jQuery ui 1.9.2.1359622485378676

Changed January 31, 2013 05:05PM UTC by tj.vantoll comment:7

status: newpending
I try to clarify the problem in jsfiddle: http://jsfiddle.net/tj_vantoll/wjxe4/. But I suddenly met a strange problem. I can't get the sortable object. $('#sortable').data('sortable') return undefined. Do you know why?

You can use

$("#sortable").data("uiSortable")
. And we still need a test case that shows the issue you're describing to look into this. Thanks.

Changed February 01, 2013 03:25AM UTC by linus.yan87 comment:8

status: pendingnew

Replying to [comment:7 tj.vantoll]:

> I try to clarify the problem in jsfiddle: http://jsfiddle.net/tj_vantoll/wjxe4/. But I suddenly met a strange problem. I can't get the sortable object. $('#sortable').data('sortable') return undefined. Do you know why? You can use
$("#sortable").data("uiSortable")
. And we still need a test case that shows the issue you're describing to look into this. Thanks.

Thanks, I have created the test case for you: http://jsfiddle.net/linus/LM4jC/. Try to drag the items, you'll see the not-removed placeholders.

By the way, why is "uiSortable" not "sortable"? It seems you made a big change from 1.8.2 to 1.9.0 on widget object getter.

Changed February 01, 2013 04:31AM UTC by scottgonzalez comment:9

By the way, why is "uiSortable" not "sortable"? It seems you made a big change from 1.8.2 to 1.9.0 on widget object getter.

1.9 upgrade guide - deprecation notice, 1.10 upgrade guide - removal notice

Changed February 01, 2013 04:33AM UTC by scottgonzalez comment:10

status: newpending

What are you actually doing that's causing this? That's an internal property that you shouldn't be setting yourself.

Changed February 01, 2013 08:37AM UTC by linus.yan87 comment:11

status: pendingnew

Replying to [comment:10 scott.gonzalez]:

What are you actually doing that's causing this? That's an internal property that you shouldn't be setting yourself.

I'm not sure if you know there is a browser bug about iframe. When iframe is in a draggable item, and it's dropped, the iframe will be refreshed. This is a headache to create pages like dashboard. Do you know JIRA dashboard? They use the absolute layout, and the dashboard item is used as the helper.

Changed February 01, 2013 01:28PM UTC by scottgonzalez comment:12

status: newpending

I have no idea how that's related to this ticket. What doe using draggable on an iframe have to do with setting an internal property on sortable? Please either describe a bug that occurs with the public APIs or describe the feature that you need.

Changed February 04, 2013 02:43AM UTC by linus.yan87 comment:13

status: pendingnew

Replying to [comment:12 scott.gonzalez]:

I have no idea how that's related to this ticket. What doe using draggable on an iframe have to do with setting an internal property on sortable? Please either describe a bug that occurs with the public APIs or describe the feature that you need.

It's a public property, I thought it was a public API. Then, I hope you can provide this feature that not to remove the helper when cancelHelperRemoval is set to true.

Changed February 04, 2013 02:31PM UTC by scottgonzalez comment:14

resolution: → notabug
status: newclosed

By that logic, EVERYTHING is public, because we use prototypes and store everything on the instances.

Changed February 05, 2013 07:14AM UTC by linus.yan87 comment:15

Replying to [comment:14 scott.gonzalez]:

By that logic, EVERYTHING is public, because we use prototypes and store everything on the instances.

That's very strange, cancelHelperRemoval is never set in any function, but you have this property to do condition statement. If you never try to set this as a public property, then, could you tell me where you have set this property internally?

Changed February 05, 2013 01:41PM UTC by scottgonzalez comment:16

It's part of an integration with draggable.