-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Setting the Row height looses centering of the text #7973
Comments
You can vertically align text in cells using CSS: .ag-cell-value {
display: flex;
align-items: center;
} Here's a code sample (CSS has been added at the bottom of index.html): https://plnkr.co/edit/kQbNq6riZfKUazy3?open=app.component.ts&preview |
That breaks text-overflow: ellipsis it's not acceptable since display: flex cannot be used with text-overflow ellipsis without the ellipsis content be wrapped into a container with for example display: block. I guess this is also the reason ag grid uses line-height with calculations to center the content so that it still supports ellipsis. So basically the default requested behaviour from the business/ multiple teams is to use ellipsis. I still think this is a bug, it should use CSS vars to calculate the line-height correctly. For all sizes line-height is uses to center the content and there is a good reason for it - ellipsis. There is a solution with a custom renderer that makes it complicated with multiple renderers or a special case where we for example activate autoHeight on the cell and ag grid will automatically add a wrapper in the cell (this is the workaround we are using now but that is a workaroud! ). |
Hello @pfteter, Thank you for the suggestion. Currently there's no way to implement this behaviour with AG Grid. Whilst we do not agree that this is a bug, we agree this would be a valuable addition to the product and we have added a feature request for this. We have added this requirement to our backlog and we are tracking it with the following reference: AG-11667 We have no timeline for this at the moment, but this can still be picked up by our team when they're making modifications to this functional area of AG Grid. Please use the functionality currently provided by AG Grid until this is delivered at a later point. See whether this item will be in the next release by checking the NEXT RELEASE checkbox on the product pipeline page: The best way to track this is to sign up for AG Grid new release notifications using the instructions here. This way you'll know as soon as a new version is out and you can check whether this specific item was implemented on the changelog page. Thanks again for bringing this up with us. Kind regards, |
Just to comment on this, the current behaviour is by design - the intention is that text in default height rows has the right amount of padding to make it appear vertically centred, but that if the row height becomes higher the text content is top aligned. Some applications rely on this behaviour to keep mixed-height content aligned. I agree it would be useful to have a feature to change the vertical alignment, I'm just explaining why this has to go through the feature request process rather than the bug fix process. |
I'm submitting a ... ```
[X] bug report => see 'Providing a Reproducible Scenario'
[] feature request => do not use Github for feature requests, see 'Customers of AG Grid'
[] support request => see 'Requesting Community Support'
The text was updated successfully, but these errors were encountered: