Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Bug with scrolling during drag of a drawitem

    Hi .
    There seems to be a bug regarding DrawItems. If you set canDrag: true, moving them by clicking inside the DrawItem body works fine. However, if you scroll whilst holding the DrawItem, the DrawItem does not scroll accordingly, but rather stays at the same height.
    The same operation works fine if you use the DrawItems "move" knob.
    This si reproducable with the latest build SmartClient_v121p_2022-04-28_Pro and also in the showcase.
    Is there any way you could fix the issue and enable mouse scrolling + canDrag?

    Thanks in advance.
    Best regards
    Simon



    Code for reproduction
    Code:
    isc.defineClass("DemoDrawPane", "DrawPane").addProperties({
        autoDraw: false,
        margin: 2,
        width: "100%",
        height: "*",
        border: "1px solid #f0f0f0",
        overflow: "hidden"
    });
    
    isc.defineClass("DemoForm", "DynamicForm").addProperties({
    
        addPropertiesOnCreate: false,
        init : function (drawItem) {
            initialValues = this.values = {};
            this.drawItem = drawItem;
            this.Super("init", arguments);
        }
    });
    
    var createSection = function (drawItem, expanded) {
    
        var title = drawItem.getClassName(),
            drawPane = drawItem.drawPane,
            knobsForm = isc.DemoForm.create(drawItem);
        return {
            title: title,
            expanded: expanded,
            controls: [knobsForm],
            items: [
                isc.VLayout.create({
                    width: "100%",
                    height: 1000,
                    members: [drawPane]
                })
            ]
        };
    };
    
    // Create the DrawItem:
    var drawRect = isc.DrawRect.create({
        drawPane: isc.DemoDrawPane.create(),
        left: 160,
        top: 30,
        width: 50,
        height: 120,
        keepInParentRect: true,
        canDrag: true,
        knobs: ["move"]
    });
    
    // Put everything together in a SectionStack.
    isc.SectionStack.create({
        width: "100%",
        overflow: "visible",
        visibilityMode: "multiple",
        sections: [
            createSection(drawRect, true)
        ]
    });

    #2
    A fix for this has been ported back to SC 12.1 and newer releases, and will be in the nightly builds dated 2022-05-06 and beyond. With the fix in place, the DrawItem being dragged by grabbing its body should jump back to your cursor position after a scroll, as you see when the move knob is dragged.

    Comment

    Working...
    X