Skip to content

animation range decrease on firefox #4

@kumm

Description

@kumm

The animation skips the first half of the range, and starts at about half-way. Sometimes the whole animation skipped. Only encounteres on firefox (tested on version 21). Deactivate your firebug while testing, because somehow it change the result.

My snippet:

    private int depth=1;

    protected void init(final VaadinRequest request) {
        final HorizontalCarousel c = new HorizontalCarousel();
        c.setSizeFull();
        c.addComponent(buildPanel());
        c.setTransitionDuration(200);
        c.setLoadMode(CarouselLoadMode.EAGER);
        final Button b = new Button("push", new Button.ClickListener() {
            @Override
            public void buttonClick(final Button.ClickEvent event) {
                final Panel p = buildPanel();
                c.addComponent(p);
                c.scroll(1);
                c.requestWidgets(depth++);
            }
        });
        VerticalLayout vl = new VerticalLayout(c, b);
        vl.setSizeFull();
        setContent(vl);
        vl.setExpandRatio(c, 1.0f);
    }    

    private Panel buildPanel() {
        Panel p = new Panel(depth+"n");
        VerticalLayout layout = new VerticalLayout();
        p.setContent(layout);
        layout.setSizeFull();
        p.setSizeFull();
        layout.addComponent(new Button("" + new Date()));
        layout.addComponent(new Label("Lorem ipsum Lorem ipsum"));
    return p;
    }

Scheduling the setChildPanelPosition call in AnimatedCarouselWidget::scrollToPanelIndex solved the problem.

if (!animationFallback) {
    Scheduler::get().scheduleDeferred([ | 
    setChildPanelPosition(animTargetPosition)
    ])
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions