javascript - How to workaround jQuery UI droppable bug where over/out do not fire if draggable element is dragging before droppable bound -


i have list of draggable objects , droppable target. view housing droppable target gets created , rendered when dragging starts. i've attached images highlighting desired action bottom of post.

the issue jquery ui appears have bug. post: droppable items not displaying hoverclass if shown during drag operation seems corroborate belief.

i have code enables draggable-ness:

this.$el.find('.videosearchresultitem ').draggable({     helper: function() {          var helper = $('<span>', {             text: videosearchresultitems.selected().length         });          return helper;     },     appendto: 'body',     containment: 'dom',     zindex: 1500,     cursorat: {         right: 20,         bottom: 30     },     start: function (event, ui) {          var draggedvideoid = $(this).data('videoid');         var draggedvideo = videosearchresultitems.get(draggedvideoid);         draggedvideo.set('selected', true);         $(ui.helper).addclass("ui-draggable-helper");      } }); 

my program has event listener video search result becoming selected. when 1 becomes selected, 'additems' view renders , transitions in.

this.listento(videosearchresultitems, 'change:selected', function (changeditem, selected) {      if (selected && this.additemsview === null) {         this.additemsview = new additemsview();         this.$el.append(this.additemsview.render().el);         this.additemsview.show();     }  }); 

additemsview initializes droppable during render:

this.$el.find('i.droppable').droppable({     hoverclass: 'icon-drop-hover',     tolerance: 'pointer' }); 

unfortunately, if draggable dragging when view rendered -- hoverclass fails 'over' event.'

i'm wondering if there's workaround this? don't see one.

enter image description here enter image description here

the solution set draggable element's "refreshpositions" option true. causes inform droppable if droppable created late.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -