Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9028 closed bug (notabug)

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.

Change History (16)

comment:1 Changed 7 years ago by tj.vantoll

Owner: set to 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/.

comment:2 Changed 7 years ago by tj.vantoll

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

comment:3 Changed 7 years ago by linus.yan87

Status: pendingnew
Last edited 7 years ago by linus.yan87 (previous) (diff)

comment:4 in reply to:  2 ; Changed 7 years ago by linus.yan87

Replying to 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?

comment:5 in reply to:  2 Changed 7 years ago by linus.yan87

Replying to 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.

comment:6 in reply to:  3 Changed 7 years ago by linus.yan87

Last edited 7 years ago by linus.yan87 (previous) (diff)

comment:7 in reply to:  4 ; Changed 7 years ago by tj.vantoll

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.

comment:8 in reply to:  7 Changed 7 years ago by linus.yan87

Status: pendingnew

Replying to 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.

comment:9 Changed 7 years ago by Scott González

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

comment:10 Changed 7 years ago by Scott González

Status: newpending

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

comment:11 in reply to:  10 Changed 7 years ago by linus.yan87

Status: pendingnew

Replying to 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.

comment:12 Changed 7 years ago by Scott González

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.

comment:13 in reply to:  12 Changed 7 years ago by linus.yan87

Status: pendingnew

Replying to 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.

comment:14 Changed 7 years ago by Scott González

Resolution: notabug
Status: newclosed

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

comment:15 in reply to:  14 Changed 7 years ago by linus.yan87

Replying to 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?

comment:16 Changed 7 years ago by Scott González

It's part of an integration with draggable.

Note: See TracTickets for help on using tickets.