user2401221
user2401221

Reputation: 519

my scrollable view scrolls but always goes back to top when released

I'm using the dojo mobile scrollable view.

The view scrolls,, but when I release it, the view goes back to top and I can not know why.

Here is an extract of my code :

var node = domConstruct.create("div", {
            id: "dtm-dialog-summary-scrollableView",
            style: "padding-top: 40px;"
        });

        var refNode2 = dom.byId("dtm-dialog-summary");
        domConstruct.place(node, refNode2);

        var view = new dojox.mobile.ScrollableView(null, "dtm-dialog-summary-scrollableView");
        view.startup();
//add a component (and many others in the scrollable view)
var divDetailledPlot1 = domConstruct.create("div", {
            "class":"div-detailled-plot",
            "id":"detailled-display-1"
        }, view.containerNode);

Thanks for your help

Upvotes: 0

Views: 227

Answers (1)

Adrian Vasiliu
Adrian Vasiliu

Reputation: 396

I've put here: http://jsfiddle.net/adrian_vasiliu/yjuWz/2/ a modified variant of your code which works for me.

Although I don't think this can have caused the trouble you describe, I removed the padding-top that you set on the ScrollableView, because this (unfortunately) forbids the scrolling to go completely to the bottom. I think this limitation will be removed in Dojo 2. Instead, as you can see in the jsfidle, I have put inside the ScrollableView an intermediate div with the needed padding-top:

var divDetailledPlot1Top = domConstruct.create("div", {
        ...
        style: "padding-top: 40px;"
}, view.containerNode);

If it still does not work for you, please tell the Dojo and browser/OS version, and provide a runnable sample to reproduce.

Edit: alternatively, just style the padding directly on the containerNode of the ScrollableView:

.mblScrollableViewContainer {
    padding-top: 40px;
}

This is implemented in http://jsfiddle.net/adrian_vasiliu/yjuWz/3/.

Upvotes: 0

Related Questions