Thanks to visit codestin.com
Credit goes to github.com

Skip to content

cursor: move not applied while dragging a tile #3044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
conner-fallone opened this issue May 2, 2025 · 2 comments · Fixed by #3046
Closed

cursor: move not applied while dragging a tile #3044

conner-fallone opened this issue May 2, 2025 · 2 comments · Fixed by #3046
Labels

Comments

@conner-fallone
Copy link

conner-fallone commented May 2, 2025

Subject of the issue

When dragging a widget around, I see that there is some CSS in gridstack that should be applying a move cursor.. however, that doesn't appear to be happening. I've traced it down to the fact that the gridstack-item has a pointer-events: none which conflicts with being able to change the cursor. If you change pointer-events to all just for testing, you'll see that the move cursor shows.

Also, should it be using grab/grabbing instead of move?

Perhaps this may be of help too, CDK Drag suffers from the same issue angular/components#20246

Your environment

  • version of gridstack.js - 12
  • which browser/OS - chrome / windows

Steps to reproduce

https://jsfiddle.net/85pj7L2s/ uncomment the commented out style to see the move cursor come in while dragging.

Expected behavior

The move cursor should be showing while dragging a tile. I would perhaps suggest switching to grab/grabbing, as move was to support IE back in the day I believe, and grab/grabbing is becoming the new norm. If this can't be supported, the css applying the move cursor should at a minimum be removed, since it's not doing anything

cursor: move;

@adumesny
Copy link
Member

adumesny commented May 4, 2025

where is pointer-events: none coiming from ? I'm not seeing it anywhere in the code (other than demo .grid-stack.show-dimensions .grid-stack-item:after example) and suprised you have to use !important to make it stick... Hummm.

yeah that used to work. grabbing is ok, but we wouldn't have grab necessarly before pressing down so might be confusing ?

Oh I see

    style.pointerEvents = 'none'; // needed for over items to get enter/leave
    // style.cursor = 'move'; //  TODO: can't set with pointerEvents=none ! (done in CSS as well)

@adumesny
Copy link
Member

adumesny commented May 4, 2025

I'm afraid I can't have it as that comment is more critical: "needed for over items to get enter/leave"
in my real app I use a custom title area so the initial cursor (to show action) is there, like https://gridstackjs.com/demo/title_drag.html

will remove CSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants