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 calculates row height only on Hover #75

Closed
ceisserer opened this issue Nov 2, 2022 · 0 comments · Fixed by #78
Closed

Grid calculates row height only on Hover #75

ceisserer opened this issue Nov 2, 2022 · 0 comments · Fixed by #78
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ceisserer
Copy link
Contributor

ceisserer commented Nov 2, 2022

When using a Grid with autoHeight enabled, lines > default height are only sized appropriatly when the mouse hovers the row, because this cases _onRowRendered to be invoked.
This is a regression compared to RAP 3.11, however I am not sure exactly which commit did introduce it.

The issue does not reproduce when creating the grid directly in createContents(), as this causes _onRowRendered to be invoked twice, where the second calls performs the correct computation. However when creating the Grid during an event, _onRowRendered is only called once, in which case the calls to computeAutoHeight() seem return some dummy value (10).

Reproducer:

public class BasicEntryPoint extends AbstractEntryPoint {

  protected void createContents(Composite parent) {
	  parent.setLayout(null);
	  
	  Button createBtn = new Button(parent, SWT.PUSH);
	  createBtn.setText("Create grid");
	  createBtn.setBounds(100, 50, 200, 20);
	  createBtn.addListener(SWT.Selection, e -> createGrid(parent));
  }
  
  protected void createGrid(Composite parent) {
	    Grid grid = new Grid(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	    grid.setData(RWT.MARKUP_ENABLED, true);
	    grid.setAutoHeight(true);
	    grid.setBounds(100, 100, 500, 500);
	    
	    GridColumn col = new GridColumn(grid, SWT.NONE);
	    col.setText("Multi Line Column");
	    col.setWidth(500);
	    
	    GridItem item = new GridItem(grid,SWT.NONE);
	    item.setText("Multi <br/> Line");
  }
}
@ifurnadjiev ifurnadjiev self-assigned this Nov 7, 2022
@ifurnadjiev ifurnadjiev added the bug Something isn't working label Nov 7, 2022
ifurnadjiev added a commit that referenced this issue Nov 7, 2022
When Grid auto-height is enabled, all rows must be updated after items
text is set. Under some conditions this is not the case.

Ensure that all rows are rendered after items text is set.

Fix #75
@ifurnadjiev ifurnadjiev added this to the 3.23 milestone Nov 7, 2022
ifurnadjiev added a commit that referenced this issue Nov 15, 2022
When Grid auto-height is enabled, all rows must be updated after items
text is set. Under some conditions this is not the case.

Ensure that all rows are rendered after items text is set.

Fix #75
ifurnadjiev added a commit that referenced this issue Nov 15, 2022
When Grid auto-height is enabled, all rows must be updated after items
text is set. Under some conditions this is not the case.

Ensure that all rows are rendered after items text is set.

Fix #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants