Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid renderes with gap between rows #11892

Closed
gatanaso opened this issue Feb 19, 2020 · 2 comments · Fixed by #11899 or #11918
Closed

Grid renderes with gap between rows #11892

gatanaso opened this issue Feb 19, 2020 · 2 comments · Fixed by #11899 or #11918
Labels
Milestone

Comments

@gatanaso
Copy link

gatanaso commented Feb 19, 2020

Description of the bug

In certain cases, when resizing the browser window or view container, the vaadin grid renders with gaps between rows:

vaadinGridRowGapBug1

grid

Inspecting the DOM reveals that there is a mismatch in the row translate3d property values:
image (5)

The above grids are created in the following way:

Grid<Person> grid3 = new Grid<>(Person.class);
grid3.setItems(Person.generate());
grid3.setSizeFull();
grid3.setId("grid3");
grid3.getEditor().setEnabled(true);
grid3.getEditor().setBuffered(false);

Expected behavior
The grid renders correctly and there are no gaps between the rows.

Actual behavior
The grid renders with gaps between rows (as can be seen in the attached images)

Steps to reproduce
We were able to reproduce this issue using the vaadin 8 sampler project: https://demo.vaadin.com/sampler/#ui/grids-and-trees/grid/features

  1. Navigate to the grid features page (https://demo.vaadin.com/sampler/#ui/grids-and-trees/grid/features)
  2. Scroll to the bottom of the grid
  3. Using the resize grid control (in the bottom right corner), resize the grid vertically up and down a few times
  4. Eventually the grid will render with gaps between rows:

Screen Shot 2020-02-25 at 09 10 22

Misc

  • Vaadin Framework version: 8.9.3
  • Browser: Chrome (also possible to reproduce in Firefox)
@gatanaso gatanaso changed the title Grid renderes empty rows Grid renderes with gap between rows Feb 19, 2020
@TatuLund TatuLund added the BFP label Feb 21, 2020
TatuLund added a commit that referenced this issue Feb 24, 2020
TatuLund added a commit that referenced this issue Feb 27, 2020
* Rewrote debouncing of onResize 

Fixes #11892

* Fixing typo in variable name
ZheSun88 pushed a commit that referenced this issue Mar 2, 2020
* Rewrote debouncing of onResize 

Fixes #11892

* Fixing typo in variable name
TatuLund added a commit that referenced this issue Mar 2, 2020
* Removing code causing the  trouble (#11898)

* Removing code causing the  trouble

Removing code that was apparently not needed in previous fix and caused regression 

Fixes: #11895

* Added feature to test UI

* Added test case

* Adding missing import

* Fixing test UI

* Enable DateField

* Rewrote debouncing of onResize (#11899)

* Rewrote debouncing of onResize 

Fixes #11892

* Fixing typo in variable name

* Adding missing setPopupPosition(left, top); (#11902)

* Adding missing setPopupPosition(left, top);

setPopupPosition(left, top); needs to be called in order to top position to be set

Fixes #11894

Co-authored-by: Tatu Lund <tatu@vaadin.com>
@ZheSun88 ZheSun88 added this to the 8.10.2 milestone Mar 3, 2020
@gatanaso
Copy link
Author

gatanaso commented Mar 4, 2020

Unfortunately the issue is still reproducible in version 8.10.2 using the same reproducing steps from above (this is from the vaadin sampler running version 8.10.2):

Screen Shot 2020-03-04 at 14 06 26

@TatuLund
Copy link
Contributor

TatuLund commented Mar 5, 2020

I have not been able to reproduce the issue after the fix. I tested the Sampler too and tried out Chrome, Firefox, Edge and IE11 and it worked ok with all of them. I have received info from others too that fix has been effective. So my understanding is that with the fix the likelihood of this problem has decreased considerably. However as you have managed to still reproduce the problem it just tells that it is still possible. I think it can be attributed to specific computer performance, mouse device etc. One could experimentally try to optimize the debounce interval, which is now 50ms (see: https://github.com/vaadin/framework/blob/master/client/src/main/java/com/vaadin/client/widgets/Grid.java#L9282 ) I would assume that with a bit longer period the likelihood of occurrence is smaller. But we do not want to have too big value there, since there will be noticeable delay after resize before Grid adjusts itself. So fundamentally it is about finding optimum between these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants