Skip to content
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

Cursor is not properly reset with draggable and connectToSortable #2152

Open
Eydamos opened this issue Feb 15, 2023 · 4 comments
Open

Cursor is not properly reset with draggable and connectToSortable #2152

Eydamos opened this issue Feb 15, 2023 · 4 comments

Comments

@Eydamos
Copy link

Eydamos commented Feb 15, 2023

If both the sortable and draggable have the cursor option set the cursor stays at the value from the draggable after the draggable was dropped.

Example to reproduce:
https://jsfiddle.net/5fxqybrs/1/
Moving the sortable elements works fine and sets the cursor to move and resets it back to auto.
But moving the draggable into the sortable keeps the cursor as move and it will never go back to auto again.

The following happens:

  • draggable start event is triggered: saves body value auto and sets cursor to move on body
  • sortable start event is triggered: saves body value of move and sets cursor to move on body
  • draggable stop event is triggered: setting cursor back to stored value of auto
  • sortable stop event is triggered: setting cursor back to stored value of move

A workaround I have implemented for now is setting the stop option of the sortable to a function which sets the cursor to auto:

    $( "#sortable" ).sortable({
      revert: true,
      cursor: "move",
      stop: function() {
          $('body').css('cursor', 'auto');
      }
    });
@ghost
Copy link

ghost commented Feb 18, 2023

it does not work for touch screens as well

@mgol
Copy link
Member

mgol commented Feb 20, 2023

Thanks for the report. Does the issue you describe exist when jQuery UI 1.12.1 is used or only with jQuery UI 1.13.0 or newer?

@Eydamos
Copy link
Author

Eydamos commented Feb 22, 2023

I just tried it in another JSFiddle with jQuery UI 1.12.1 and the problem also occurs with that version

@mgol
Copy link
Member

mgol commented Feb 22, 2023

Thanks for the report. Since the issue is already in 1.12, given limited team resources it's not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/. PRs are welcome if they're not too complex.

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

No branches or pull requests

2 participants