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

Fix undefined error due to columnIdx out of bounds #3372

Merged
merged 3 commits into from
Oct 20, 2023

Conversation

amanmahajan7
Copy link
Contributor

@amanmahajan7 amanmahajan7 commented Oct 20, 2023

Closes #3369

@amanmahajan7 amanmahajan7 self-assigned this Oct 20, 2023
@amanmahajan7 amanmahajan7 marked this pull request as ready for review October 20, 2023 15:36
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #3372 (6507666) into main (8d4a627) will increase coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

❗ Current head 6507666 differs from pull request most recent head cb21e5d. Consider uploading reports for the commit cb21e5d to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3372      +/-   ##
==========================================
+ Coverage   83.15%   83.17%   +0.02%     
==========================================
  Files          47       47              
  Lines        5092     5100       +8     
  Branches      795      796       +1     
==========================================
+ Hits         4234     4242       +8     
  Misses        858      858              
Files Coverage Δ
src/DataGrid.tsx 88.87% <100.00%> (+0.07%) ⬆️

nstepien
nstepien previously approved these changes Oct 20, 2023
src/DataGrid.tsx Outdated
@@ -690,6 +690,7 @@ function DataGrid<R, SR, K extends Key>(
function isCellEditable(position: Position): boolean {
return (
isCellWithinViewportBounds(position) &&
position.idx !== -1 &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isCellWithinViewportBounds doesn't catch this? 🤔
Should we add a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be we need to add a new function withinEditBounds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how to test it. I will check

@amanmahajan7 amanmahajan7 requested a review from nstepien October 20, 2023 16:23
@amanmahajan7 amanmahajan7 enabled auto-merge (squash) October 20, 2023 16:23
@amanmahajan7 amanmahajan7 merged commit ae2d77f into main Oct 20, 2023
2 checks passed
@amanmahajan7 amanmahajan7 deleted the am-fix-grouping-edit-error branch October 20, 2023 16:24
adityatoshniwal pushed a commit to pgadmin-org/react-data-grid that referenced this pull request Jul 31, 2024
* Check columnIdx  is within bounds

* Add helper

* Inline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants