johnny / johnny/jquery-sortable

Jquery sortable in contextMenu not working in mozilla firefox

Open
#246 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
1.5k
Forks
429
PR merge metrics
No merged PRs in 30d

Description

Am working on jquery context menu with menu items are sortable using jquery sortable,

This working fine in Chrome but while working on Mozilla firefox context menu item sticks on to mouse cursor while sorting.

below is my code:
```





jQuery UI Sortable - Default functionality







right click me



$(document).ready(function() {
$( "#sortable" ).disableSelection();

var items = {
first: {
name: "Item 1",
isHtmlName: true
},
second: {
name: "Item 2",
isHtmlName: true
},
third: {
name: "Item 3",
isHtmlName: true
}
}

$.contextMenu({
selector: '.context-menu-one',
autoHide: true,
items: items,
events: {
show: function() {
$('#sortable').sortable({
items:'li:not(.context-menu-header)'
});
}
}

});

$('.context-menu-one').mousedown(function(e){
if(e.button == 2) {
$('ul.context-menu-list').attr('id', 'sortable');
}
});

});



```

Below image is getting while working on firefox:

![untitled](https://user-images.githubusercontent.com/15795961/34245719-49e3fe08-e651-11e7-849b-2a07f2edd202.png)

you can see that context menu item is stick on to mouse cursor in firefox.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.