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

Issue double clicking column header border to 'resize' to content width #283

Open
sparqicus opened this issue Jun 27, 2023 · 1 comment
Open

Comments

@sparqicus
Copy link

What is the expected behavior?

When double clicking on the resize handle - I would expect that it would always resize to content.

What is the current behavior?

In certain conditions - if you resize a column down to its smallest size, and double click the column resizer to normalize the size - you'll see it pops over about 2px or so, but doesn't go to the correct width.

What are the steps to reproduce?

You can see an example here

  • resize 'name' down to smallest size, then double click resizer border.

Which versions of Angular, CDK, Material, NGrid, OS, TypeScript, browsers are affected?

My work is using latest angular 14 and related libraries. NGrid 15. But unsure what versions the example above is using.

Is there anything else we should know?

I'm running into this in a work system, and they're requiring a fix. I'm going to play around with min-widths and stuff, because not all of the example grids seem to do this.

@sparqicus
Copy link
Author

Okay - so I think I found the issue.

When the column wraps or ellipses in an unexpected way (extra nesting or whatever), the code can't properly guess the width of the column.

If you're running into this, and for some reason it's a big deal, check your css to make sure you're not adding extra child containers (like a custom cell template or something), and if you are, remove text-overflow ellipses everywhere, and it'll probably work for you.

I had a custom cell specifically to add a title attribute, but removed it and switched to the tooltip feature.

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

No branches or pull requests

1 participant