Giter VIP home page Giter VIP logo

Comments (4)

BernieSumption avatar BernieSumption commented on June 9, 2024 1

I still think this is a bug, it should use CSS vars to calculate the line-height correctly.

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.

from ag-grid.

BernieSumption avatar BernieSumption commented on June 9, 2024

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

from ag-grid.

pfteter avatar pfteter commented on June 9, 2024

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.
For getRowHeight its forced breaking the line-height calculation resulting in the content displayed on top.

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! ).

from ag-grid.

AG-Zoheil avatar AG-Zoheil commented on June 9, 2024

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:
https://www.ag-grid.com/ag-grid-pipeline/

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,
Zoheil

from ag-grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.