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

split-grid: fix #213 - opening collapsed columns may fail #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RonaldTreur
Copy link

@RonaldTreur RonaldTreur commented Nov 10, 2020

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.

…fail

Instead of using a trackIndex (track) retreived by searching for a non-zero value in a filtered (potentially smaller) array, get the index from the actual trackValues array and skip creating filtered array variants

Additionally:
* remove redundant outer `if`-blocks and associated computations, surrounding the fraction/percentage `..ToPixel`-calculations
* expand utility tests to fully test updated `firstNonZero` function
@rassie rassie mentioned this pull request Nov 10, 2020
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

Successfully merging this pull request may close these issues.

1 participant