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 columns with body template are not resized correctly on initialization with width='auto' #1046

Closed
dobromirts opened this issue Jan 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working status: resolved

Comments

@dobromirts
Copy link
Contributor

Description

Upon initialization, grid columns containing a body template have incorrect resizing when width='auto' is set. This leads to an issue where the column content overlaps with the adjacent column.

Steps to reproduce

  1. Add grid component.
  2. Create a body template and add it to some of the grid columns.
  3. As content include a element with width that will overlap with the other columns if explicit column height or width='auto' are not set.
  4. Set width='auto' to the column.
  5. Start the application and observe the column widths.

Result

The column featuring the specified template is overlapping with the adjacent column.

Expected result

On initialization the columns with defined templates to be resized correctly.
The same approach works as expected for igniteui-angular grid.

Attachments

Sample - column-templates-initialization.zip

image

@dobromirts dobromirts added bug Something isn't working 🆕 status: new The issue is new and will be reviewed when somebody picks it up. labels Jan 25, 2024
@dkamburov
Copy link

@dobromirts Can this be reproduced in the angular grid as well?

@dobromirts
Copy link
Contributor Author

dobromirts commented Jan 30, 2024

@dobromirts Can this be reproduced in the angular grid as well?

No, with angular grid on initialization, the columns containing templates are resized according to their widths

@MayaKirova
Copy link

@dobromirts @dkamburov Technically, it's not a problem with the body template itself, more with the fact that web components do not initialize instantly when injected in the DOM, so they don't have their actual size when measured. If you put something that is not a web component in the template, for example a simple button, then it will have it's actual size when rendered and will be measured correctly. Added some handling for such scenarios in angular.

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

No branches or pull requests

3 participants