split-grid: fix #213 - opening collapsed columns may fail #430
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.
Solution: Instead of using a track index (
track
in the original code) retrieved by searching for a non-zero value in a filtered (potentially smaller!) array, this code gets the index from the actual trackValues array directly.Because the outer if-loops surrounding the
..ToPixel
-calculations were redundant to begin with, I removed both them and the filtered track arrays.Major kudos to @rassie for detecting the actual issue! I created a new PR since his (#357) failed some linting checks and because I had a slightly different direction in mind. I believe these changes do more justice to @nathancahill his codebase.
Originally I wanted to use Array.findIndex for the
firstNonZero
-function, but it looks like IE10 is still being used by Saucelabs to check the code, so I decided to stick to the original for-loop and not mess with it anymore than necessary.Finally I updated the utility tests for to reflect the changes made to the
firstNonZero
-function.