[DataGrid] Fix getCellElement
method not working with pinned columns
#7354
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7093
Fixes #7819
Problem
previously
getGridCellElement
will select the row and try to choose the cell of that row which works in most cases but if there are multiple rows like when using column pinning. it will only select the first row and ignore the rest row. if the cell is not in the first rowgetGridCellElement
will always return null.bandicam.2022-12-30.23-08-03-195.mp4
solution
instead of selecting the row first and trying to select the cell from the rows. we should try to query the cell from all the rows at once.
Before: https://codesandbox.io/s/vsxdnp?file=/package.json
After: https://codesandbox.io/s/charming-sanne-c4cjin