You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
item can overlap calling update() and locked items #1959
thanks for the bug report. can you make sure it still happens with latest rev ? (5.0.0)
I'm guessing this is only and issue with locked items (which should fail to move).
Correct it's only an issue with locked items. Unlocked items behave as you would expect.
I can also confirm this issue persists on 5.0.0.
Sorry I didn't realize the fiddle I usurped to make the demo wasn't using latest rev. Here is an updated fiddle pointing at latest rev and behavior remains the same.
I also want to note that I am currently working around the issue by using the isAreaEmpty api call to check if the update should proceed. It works to prevent the overlap, but it obviously stops any sort of skip over code from executing. As such it simply serves to cover the "item does not move at all" expected behavior... although that is certainly less ideal than having the item skip over to a valid area above the item.
if you move up by 1 and it has a locked item, it should fail to move and stay put (moving above - you can do that manually by moving enough past 1 to mean ok go before that locked items, but doing similar heuristics (say move by 2 but you really need 3 to clear a locked item) would be much harder to implement...
if you want to donate something, I can probably find some time, but I'm really swamped these days otherwise... you might be able to work around it by checking the item at that location and checking for lock (not just empty)
changed the title [-]Grid items are allowed to overlap when moving upwards during an update event[/-][+]item can overlap calling update() and locked items[/+]on Sep 17, 2022
Activity
adumesny commentedon Apr 29, 2022
thanks for the bug report. can you make sure it still happens with latest rev ? (5.0.0)
I'm guessing this is only and issue with locked items (which should fail to move).
giantroboticcat commentedon Apr 29, 2022
Correct it's only an issue with locked items. Unlocked items behave as you would expect.
I can also confirm this issue persists on 5.0.0.
Sorry I didn't realize the fiddle I usurped to make the demo wasn't using latest rev. Here is an updated fiddle pointing at latest rev and behavior remains the same.
https://jsfiddle.net/bhkm95gt/1/
I also want to note that I am currently working around the issue by using the isAreaEmpty api call to check if the update should proceed. It works to prevent the overlap, but it obviously stops any sort of skip over code from executing. As such it simply serves to cover the "item does not move at all" expected behavior... although that is certainly less ideal than having the item skip over to a valid area above the item.
adumesny commentedon Apr 29, 2022
if you move up by 1 and it has a locked item, it should fail to move and stay put (moving above - you can do that manually by moving enough past 1 to mean ok go before that locked items, but doing similar heuristics (say move by 2 but you really need 3 to clear a locked item) would be much harder to implement...
if you want to donate something, I can probably find some time, but I'm really swamped these days otherwise... you might be able to work around it by checking the item at that location and checking for lock (not just empty)
[-]Grid items are allowed to overlap when moving upwards during an update event[/-][+]item can overlap calling update() and locked items[/+]* fix gridstack#1959 refuse a move that would land on a locked item
Merge pull request gridstack#3422 from adumesny/master