I have a route view that uses AppLayout and extends VerticalLayout. The constructor adds a bunch of fields, and the fields are not visible below the bottom of the screen using add(…). Is there a way make the content of the VerticalLayout scrollable?
@Route(value = “note/:document-id”, layout = MainAppLayout.class)
public class NoteViewImpl extends VerticalLayout implements BeforeEnterObserver, NoteView { … }
This should work out of the box
Can you show your constructor
public NoteViewImpl(final NoteController noteController) {
this.noteController = noteController;
//
setWidth("100%");
// Header
add(header);
// Form
add(datePicker);
add(agenda);
add(organizer);
add(counterpart);
add(discussionPoints);
add(decisionsMade);
add(actionItems);
add(feedback);
add(shareCheckbox);
// Control buttons
add(new HorizontalLayout(saveButton, cancelButton));
// Attach the controller
this.noteController.attach(this);
}
I’ve notices something strange. If there is vertical overflow at the view at the construction time, then the scroll is not working. If view is smaller than the browser window, and then I reduce the browser window size for the vertical overflow to start happening, the scrolling works. So it looks like there is some logic inside Vaadin that tries to figure out what’s visible and how it relates to the size of the vindow and disables / enable the scrolling.
Another discovery. When I put my laptop’s mouse pointer over a field, and use the scroll gesture, scrolling works. If I move the mouse pointer away from any elements on the page, scrolling stops working.
I can’t see anything problematic. Could you provide a reproducible example or share your code?
@adaptable-uakari After more experimenting, I don’t think this is Vaadin-related anymore. I see the same behavior in other apps. I