ScrollTarget: Wrap things and make visible

ScrollTarget demo recording

Scroll Target for Flow

Vaadin 10+ Java integration of https://github.com/fluorumlabs/scroll-target

<scroll-target> is a really simple web component for making scrolling easier. ll you need to do is to wrap the content you want to scroll to and call ensureVisibility():

ScrollTarget target = new ScrollTarget(new Paragraph("..."));

...

target.ensureVisibility();

Methods

ScrollTarget.setTopOffset(<offset_in_pixels>);

setTopOffset defines a space that should be reserved for fixed top menu when scrolling. Can be set via top-offset attribute.

ScrollTarget.ensureVisibility();

ScrollTarget.ensureVisibility(<delay_in_milliseconds>);

ensureVisibility scrolls to make the wrapped content visible. If optional <delay_in_milliseconds> is specified, scrolling will be delayed by specified amount of time.

Install

Link to this version
ExperimentalReleased 04 April 2019Apache License 2.0
Framework Support
Vaadin platform 10+
Browser Compatibility
11
Install with
Release notes - Version 1.0.0