nestedSortable
nestedSortable copied to clipboard
still shows next level nesting despite maxLevels being set
It appears that if you set maxLevels, it works as expected in that you can't nest farther than the depth specified. However when dragging, the placeholder will still move one level further. Of course if you try and drop at a level deeper than what's specified by maxLevels it moves back to it's original place.
This looks like an error.
It shouldn't even show the next level if it's been defined in maxLevels to be less than that. It also makes the user align their nesting perfectly to get it to drop properly, otherwise you risk having your item moved back to it's original spot.
Looks like #72 has pointed this out as well! Can we get a fix?
I don't think this is a bug. Just set a style for your defined "errorClass" for your placeholder, ie. give it a red background and it will make more sense.
@noraheuer It definitely is a bug in my opinion. If someone drags to that space and it "opens up" to let them drop, why even do that if they're not allowed? Simply setting an error color is not helpful. It doesn't tell the user why they can't drop there.
You shouldn't have to add UI for an action that isn't allowed to begin with. That's like if "hidden" input fields were visible, but you could put a red x over it. Defeats the purpose. It just shouldn't show.
To add to this, there's a setting to disable pages from having children. I don't have to set an "errorClass" for that because it simply doesn't even allow someone to nest pages.
This same approach should be applied in conjunction with the maxLevels setting.
good points.