- Notifications
You must be signed in to change notification settings - Fork1.9k
Fixed undefined ref error when setting a data validation that is a range of cells at the worksheet level#1480
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…nge of cells at the worksheet level
Bene-Graham commentedSep 30, 2020
alubbe left a comment
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.
Thank you for this PR, I just have some minor modifications that I'd like to see and then we're good to go
spec/integration/issues/issue-1027-sheet-defined-data-validate.spec.js OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
spec/integration/issues/issue-1027-sheet-defined-data-validate.spec.js OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
alubbe left a comment
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.
thank you!
Fixed undefined ref error when setting a data validation that is a range of cells at the worksheet level
Summary
In the case where a data validation is set at the worksheet level with a range of cells "A1:A100" the error
Cannot set property 'marked' of undefinedwould occur.From what I could tell the original code would call
const addr = colCache.decodeAddress(dv.address);this would return the value "A1" in the case of the following "A1:A100". Later on in the code it would try to mark "A1"dvMap[otherAddress].marked = true;, but in the dvMap it would be "A1:A100" and the error occurs.I changed decodeAddress to decodeEx so that we can detect if the address is a single cell vs a range(dimension?). If a dimensions property exist on the return object from decodeEx, it will shortcircuit and use the range.
Test plan
I added a integration test demonstrating it now works with no error:
spec/integration/issues/issue-1027-sheet-defined-data-validate.spec.js