Skip to content

can't drag between 2 grids with max row set #1687

Description

@Justin99b

Subject of the issue

Widgets collide and bug over each other when hovering over another grid

Your environment

Gridstack (the verison used on the official site) sorry dont know that one) (V4 if im not mistaken) <- 4.0.1
Chrome Version 89.0.4389.90 (64-Bit)

Steps to reproduce

https://gridstackjs.com/#demo
when moving the item from top to bottom (i hope thats eough to reproduce)

Expected behavior

Widget does not collide with others and just can correctly place back like in the previous v3 versions

Actual behavior

When dragging one widget to another grid and then back (without releasing it) the widget will come nearly impossible to place back in the old grid and even collid or stack on to another object.
Its also happening when just dragging it into another grid.
You can also see the collision happening here https://gridstackjs.com/demo/advance.html
p.s im sorry if im not giving enough information.
if you need anything more please comment

Activity

  1. adumesny commented on Mar 27, 2021

    @adumesny
    Member

    can you please provide a video because I'm not seeing your issue. you can also try using https://gridstackjs.com/demo/two.html or a modified version if you need 2 grids.

  2. Justin99b commented on Mar 27, 2021

    @Justin99b
    Author
  3. changed the title [-]Dragging widget to another grid makes it impossible to place[/-] [+]two drop shadows when dragging between 2 vertical grids[/+] on Mar 27, 2021
  4. adumesny commented on Mar 27, 2021

    @adumesny
    Member

    should not see two drop shadow when #393 was fixed....

    Also see issues with your demo outside of this:

    1. you say 3 column but don't include extra.css so CSS layout is hosed when dragging around.
    2. you call addGrid() which creates nested .grid-stack divs (I have a local fix) as parent incorrectly has '.grid-stack' style (see you CSS doubling the border)
    3. resize handles are always showing. resizable:false is NOT an options - use disableResize:true instead (I can see why you made that mistake)

    regardless I can see 2 drop shadows when doing vertical grids, so I will create demo for that so I can fix.

  5. Justin99b commented on Mar 27, 2021

    @Justin99b
    Author

    oh? Well im working on an inventory system with gridstack and use addGrid to dynamicly add grids. didnt know that this is the wrong way of doing it

  6. Justin99b commented on Mar 27, 2021

    @Justin99b
    Author

    Okay i've updated my example with your fixes named just to make sure its correct

    https://jsfiddle.net/hfjr65qw/32/

    Also its not only the drop shadow
    here is a video of it happening in a different scenario. but you can recreate it with the link above

    This example is even more broken than my version somehow lol

    https://gyazo.com/3aa64bfd28f08147595a66440fff6a81
    https://gyazo.com/a77811b3982037bf013b5653b2003a5a

  7. adumesny commented on Mar 28, 2021

    @adumesny
    Member

    Also its not only the drop shadow

    I know, but that is the clue bad things will happen!

    Update: actually the real issue with is with row:1 setting maxRow which goes through very different code path I had not tested

  8. changed the title [-]two drop shadows when dragging between 2 vertical grids[/-] [+]can't drag between 2 grids with max row set[/+] on Mar 28, 2021
  9. added a commit that references this issue on Mar 28, 2021
    5bc3a42
  10. adumesny commented on Mar 28, 2021

    @adumesny
    Member

    fixed in next release. don't forget to donate if you find lib useful!

  11. Justin99b commented on Mar 28, 2021

    @Justin99b
    Author

    If my projects works out and dont forget it i will donate you something 😄

    I checked out the master after you pushed. It seem to work way better than before

    Im still having problems with the shadow tho. i have a 1x1 field to drop an item into.
    besides the fact that 1x1 fields dont work at all in v3 and in v4 with your fix it works somewhat

    Sometimes the drop shadows still wont dissapear. I will test this further and make sure to make a demo for you

    Do you mean 4.0.3 or master when you say release?

  12. adumesny commented on Mar 29, 2021

    @adumesny
    Member

    4.0.3

  13. adumesny commented on Mar 29, 2021

    @adumesny
    Member

    a change in 4.0.3 broke my example (like yours).... will have to revisit this. Lot more work than expected. Get that donation going...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions