Results 1 to 4 of 4

Thread: SortableList should disable hover during drag

    You found a bug! We've classified it as EXTJS-27518 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,257

    Default SortableList should disable hover during drag

    It just looks weird. Possible fix:

    Code:
    Ext.define(null, {
        override: 'Ext.dataview.plugin.SortableList',
    
        onDragStart(source, info) {
            this.callParent([source, info]);
            // CHANGES BELOW
            const list = this.getList();
            list.doHover = false;
            list.toggleHoverCls(false);
        },
    
        onDragEnd(source, info) {
            var me = this,
                list = me.getList(),
                item = info.item,
                style = info.item.el.dom.style,
                compareItem = list.mapToItem(info.index),
                top, pos;
    
            item.getTranslatable().on('animationend', function() {
                if (me.destroyed) {
                    return;
                }
    
                var store = list.getStore(),
                    startIndex = info.startIndex,
                    index = compareItem ? compareItem.getRecordIndex() : list.getStore().getCount(),
                    rec = item.getRecord();
    
                list.stickItem(item);
                list.setGaps(null);
    
                if (startIndex !== index) {
                    store.insert(index, rec);
                    index = store.indexOf(rec);
    
                    // Since we've moved the item, it may have changed, grab it again
                    item = list.mapToItem(rec);
                    list.fireEvent('dragsort', list, item, index);
                }
                item.removeCls(Ext.baseCSSPrefix + 'item-no-ripple');
                // CHANGE HERE
                list.doHover = true;
            }, me, {single: true});
    
            if (!compareItem) {
                pos = list.mapToItem(info.index - 1).$y1;
            } else {
                pos = compareItem.$y0;
            }
    
            // Dragging uses left/top, so make it translate instead
            top = item.element.getTop(true);
            style.left = style.top = '';
            item.translate(0, top);
            item.translate(null, pos, {duration: 100});
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,005

    Default

    Thank you for bringing this to our attention Evan. I will send this to the team for further investigation.

  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    567

    Default

    Hello Evan, hope you are doing well.

    Appreciate your post, I will go ahead and raise a bug with solution for the concerned team. The reference ticket will be attached here for you to track the progress.

    Regards,
    Kumar
    Sencha Support.

  4. #4
    Sencha Staff
    Join Date
    Sep 2017
    Posts
    126

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Similar Threads

  1. Replies: 3
    Last Post: 25 Aug 2018, 12:10 AM
  2. drag and drop hover issue
    By rajan_m in forum Ext JS 6.x Q&A
    Replies: 3
    Last Post: 9 Aug 2017, 6:18 AM
  3. Tree + Drag n Drop disable selection during drag
    By dustismo in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 19 Oct 2011, 7:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •