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

possible bug in packages/core/src/internal/data-grid/render/data-grid-render.header.ts #947

Open
A-Posthuman opened this issue Apr 21, 2024 · 0 comments

Comments

@A-Posthuman
Copy link

I'm using the new alpha code for the header indicator icon, and also I've modified the code a bit to support right alignment (not rtl, just normal ltr but right aligned within the header cell) of the header text, and to support wrapping the text onto 2 lines.

Anyway while working on that I realized in this code at line 382 where it computes textBounds.width, the calculation was sometimes returning negative numbers, which I assume is incorrect. I modified it my version to:

width: (x + width) - drawX - xPad

That seems to generate better results.

Also the code just below there at line 392 which modifies textBounds.width in the case of a header indicator icon, I was sometimes seeing the new width set to too low of a number. I didn't have time to trace that all the way back to see what was happening, I changed mine to:

textBounds.width -= headerIconSize + xPad;
drawX += textBounds.width + xPad;
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