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)
])
}
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) ]) }