vaadin / vaadin/framework

Infinity scoll in firefox

Open
#11,625 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Stale
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Versions and Systems
  • Vaadin version: 8.8.3 with compatibility packages
  • Browser version: firefox 66.0.5 released 2019-05-09 and higher. Firefoxes from before work well. Explorer and chrome works well. Back versions tested on portable firefox https://www.firefox-usb.com/.
  • Operating system: bug is reproducible on both linux and windows
  • Web container: tomcat
Description of the bug

1.) Create filtering table that has many rows and loads slowly. Demo is using wait(100) inside column generator to simulate slow calculation.
2.) Use mouse wheel to slowly scroll down. When loading page shows up, scroll just a bit further and then stop moving the mouse.
3.) The table will continue slowly scrolling down till it reaches end of data.

Minimal reproducible example
@Theme("demotheme")
public class FilteringTableBugDemo extends UI {
	@Override
	protected void init(VaadinRequest vaadinRequest) {
		final VerticalLayout layout = new VerticalLayout();
		layout.addComponent(new Label("Use firefox 66.0.5 released 2019-05-09 and higher. Firefoxes from before work well. "));
		layout.addComponent(new Label("Scroll slowly down. When loading page shows up, scroll just a bit and then stop.  The table will continue scrolling till infinity."));
		table(layout);

		setContent(layout);
	}
	
	@SuppressWarnings("deprecation")
	private void table(VerticalLayout layout) {
		Table table = new Table();
		table.addContainerProperty("col1", String.class, "");
		table.addContainerProperty("col2", String.class, "");
		table.addContainerProperty("col3", String.class, "");

                // slowly loading column - causes the but
		table.addGeneratedColumn("col4", (t, itemId,columnId) -> {
				sleep(100);
				return "generated " + itemId ==null ? null : itemId.toString();
			}
		);

		Container container = table.getContainerDataSource();

		// many rows
		for (int i = 0; i < 5000; i++) {
			String itemId = "row_" + i;
			Item item = table.addItem(itemId);
			item.getItemProperty("col1").setValue("another " + i);
			item.getItemProperty("col2").setValue("aaaa " + i);
			item.getItemProperty("col3").setValue("bbbb " + i);
			
		}
		
		layout.addComponent(table);
		
	}
	
	protected void sleep(int time) {
		Object lock = new Object();
		synchronized (lock) {
			try {
				lock.wait(time);
			} catch (Throwable e) {
				System.out.println(e);
			}	
		}
	}

	@WebServlet(urlPatterns = "/bug/*", name = "BugReportUIServlet", asyncSupported = true)
	@VaadinServletConfiguration(ui = FilteringTableBugDemo.class, productionMode = false)
	public static class DemoUIServlet extends VaadinServlet {
	}

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the FilteringTableBugDemo minimal reproducible example in the issue and reproduce the continued scrolling in Firefox 66.0.5 or newer with a slow generated column and 5,000 rows. Trace the Vaadin Table loading and scrolling behavior triggered by the mouse wheel, then verify that scrolling stops when the user stops moving it without regressing Chrome or Internet Explorer behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.