-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[RAC] fix the alerts table hidden rows due to miscalculated height #121399
[RAC] fix the alerts table hidden rows due to miscalculated height #121399
Conversation
const additionalFiltersHeight = 44; | ||
const filtersHeight = 32; | ||
const headerHeight = 40; | ||
const paginationHeight = 36; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is added even if there is no pagination, but since it occupies the whole page, having a gap under the table is ok.
Looks legit code wise. Can you please add a screenshot of the grid before/after the fix with a full and a half-empty page? 🙏 |
…alerts-table-height-hack
Hey @ersin-erdal 👋 I also created a PR for this issue. In that fix, I am simply adding an extra row height to the overall height to compensate for the miscalculation. I refrained from changing the logic too much because there seemed to be quite some edge-cases :D The wrongly-calculated height issue in DataGrid has also been fixed in a recent EUI update and has been even more imrpoved in a follow-up PR so this PR does not need to target |
Hi @janmonschke, we've been also waiting for the new EUI version. Unfortunately your solution wont fix the bug... it occurs when there are 2 or 3 alerts as well. edited: i can't add v7.17.0... it uses a different EUI version which uses a different table-row height... |
@elasticmachine merge upstream |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
@ersin-erdal thanks for the clarification. I have since checked my solution in 8.0 against a scenario with 3 alerts on the last page and it fixes that case as well. It adds an additional row's height to make up for the miscalculation which is only wrong by about a row's height: Screen.Recording.2022-01-11.at.11.02.12.movI understand that your PR also updates the height constants which is why it makes sense to not target 7.17. Do you know when the new row heights were introduced in EUI? I am struggling to find out which release it actually was. I am asking because maybe the new row height only changed in main but not in 8.0. When I check out 8.0 locally, the row height is still 34px: Here's the list of the different EUI versions by branches
|
I have create a new PR that removes the height hack now that EUI 44.0.0 was merged into main. (#122755) Going forward I think it might make sense to close this PR then and to backport my other PR (#122542) to 8.0 and 7.17 to fix the rendering issue there. Let me know what you think about this approach :) |
Hi @janmonschke that totally make sense to me. |
Fixes: #119310
Due to a bug in DataGrid, timeline's t_grid passes the calculated table height as prop.
It was too complex and calculating the height wrong.
Added missing pagination section height in calculation and simplified the hook.
There can be 3 conditions for the height calculation:
if (rowCount < pageSize){...} else {...}
could cover all the cases above.And since useLayoutEffect is a synchronised hook, setTimeout shouldn't be needed either.
But, i may miss some edge-cases, please test this and let me know if there is a missing case.