nestedSortable icon indicating copy to clipboard operation
nestedSortable copied to clipboard

When 'disableNesting' is set, those elements still have drop zones

Open takempf opened this issue 13 years ago • 12 comments

When I set disableNesting: 'file', it properly disables the specified class, but it doesn't disable the drop zone, leading to some very confusing user experience. Is there any way to disable a certain type of element AND disable its drop zone?

takempf avatar Aug 29 '12 01:08 takempf

I came here to post this same exact issue. Upvote!

codeclown avatar Aug 31 '12 20:08 codeclown

The placeholder is still shown because you may want to style it, say, with a red background (see my demo) to hint the user that he can't drop there.

If you want to disable the drop zone you could try setting the placeholder height to 0... Anyway this feature request has been coming up a few times recently, a future update might include an option for disabling the drop zone altogether, but I can't say when.

mjsarfatti avatar Sep 06 '12 14:09 mjsarfatti

I came here to post this as well.

EDIT #1: I was able to emulate this exact behavior by setting "display: none;" on the error class. This completely hid the dropzone and removed its spot. This is exactly what I wanted.

disableNesting: 'notemenu_error'

 .notemenu_error {
    display: none;
 } 

EDIT #2: There is still a small problem with this method for nested items. It means when trying to sort and drop under an item nested under another item, when you are to the right of the tabSize value then you have no dropzone. The correct behaviour I believe would be for the dropzone within the tabSize area to extend fully to the right as if you were dropping below the above item and not trying to drop nested inside it. Essentially when an item has nesting disabled, I do not want it to detect a drop zone below it (even if I hide it with my CSS it still detects it) so that the dropzone from the parent can still appear there like it would normally if the nonest item was not existing. I hope that made sense; it's a bit difficult to explain. If you do add the feature to disable the drop zone please consider making it function as I describe if possible. Will feed hungry programmers for fix. :D

Thank you very very much for this great tool.

dustinbolton avatar Oct 25 '12 08:10 dustinbolton

Hi Dustin, I got your point. It makes sense, it will definitely be part of version 2.0. Hopefully soon, by the end of next week.

mjsarfatti avatar Oct 25 '12 09:10 mjsarfatti

Thank you Manuele, I too would make use of this feature. I'm watching for version 2.0.

gihrig avatar Oct 26 '12 06:10 gihrig

+1

scriby avatar Nov 08 '12 19:11 scriby

https://github.com/mjsarfatti/nestedSortable/tree/2.0alpha

mjsarfatti avatar Nov 08 '12 21:11 mjsarfatti

I noticed this and have it integrated and working.

Thanks!

scriby avatar Nov 08 '12 21:11 scriby

Great :)

mjsarfatti avatar Nov 08 '12 21:11 mjsarfatti

Seems to work perfectly in the 2.0 alpha so far in my testing. I'll keep trying things out and customizing. Donating for the awesome work! :) Thank you.

dustinbolton avatar Dec 11 '12 09:12 dustinbolton

Discovered a single 2.0 alpha "glitch" that is similar / possibly related. Reproducible in demo for 2.0alpha: http://mjsarfatti.com/sandbox/nestedSortable/

Reproduction steps:

  1. Pick up Item 2.
  2. Hover it over Item 1 to expand it.
  3. Hover it between Item 1 and Sub Item 1.1. (placeholder is now on same level and above Sub Item 1.1.
  4. Move the mouse up so that you are hovering over the middle of Item 1. (the placeholder should stay in the same place).
  5. Move the mouse back down to where the placeholder currently is. (the placeholder will now drop to the BOTTOM of this section rather than staying put).

It seems to be the issue happens whenever exiting the ol and re-entering it via the top. I played around with CSS a bit to see if I could work around the issue that way but no luck so far.

dustinbolton avatar Dec 12 '12 09:12 dustinbolton

Sorry for replying late. Thanks for the bug report, will look into that! It's a minor glitch, so it won't get high priority...

2012/12/12 Dustin Bolton [email protected]

Discovered a single 2.0 alpha "glitch" that is similar / possibly related. Reproducible in demo for 2.0alpha: http://mjsarfatti.com/sandbox/nestedSortable/

Reproduction steps:

  1. Pick up Item 2.
  2. Hover it over Item 1 to expand it.
  3. Hover it between Item 1 and Sub Item 1.1. (placeholder is now on same level and above Sub Item 1.1.
  4. Move the mouse up so that you are hovering over the middle of Item 1. (the placeholder should stay in the same place).
  5. Move the mouse back down to where the placeholder currently is. (the placeholder will now drop to the BOTTOM of this section rather than staying put).

It seems to be the issue happens whenever exiting the ol and re-entering it via the top. I played around with CSS a bit to see if I could work around the issue that way but no luck so far.

— Reply to this email directly or view it on GitHubhttps://github.com/mjsarfatti/nestedSortable/issues/47#issuecomment-11282391.

mjsarfatti avatar Jan 04 '13 08:01 mjsarfatti