-
Notifications
You must be signed in to change notification settings - Fork 3k
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
The getCell
method should not return undefined
#5608
Comments
I've run into this and sadly its causing a lot of issues in our app. In my app I can consistently reproduce it by:
After that point I can't close the dropdown or enter values in any cells. 😞 It happens sometimes when entering valid values as well, just not 100% of the time. Debugging this almost all day today with another dev (not exaggeration, sadly) I found that:
The above error could be fixed by:
Other info:
|
Alright, I have a reproducible demo. I just needed enough columns, and the error only happens with changes in fixed left columns. Here's the demo: https://jsfiddle.net/kfwg7jeL/2/
|
Wow, thank you for doing the investigation for you and the colleague. |
So it seems like I came full circle to what was described in the original comment:
The question is: what's the correct fix? It seems that maybe the function should return
And a few places may need to be updated to expect this return. Is that about right? Unless someone disagrees I can put in a PR. This would fix a nasty bug we've encountered in our app during testing! |
@aaronbeall Once again, thanks for the investigation! Your
But this would require some more thought to make it consistent with other methods, making sure it works with everything that depends on tl;dr: It's definitely good enough for now! Thanks a lot! |
@jansiegel Yeah, I completely agree about the return value. My thought was to return |
Hey @aaronbeall I'm happy to announce that we've updated the Handsontable to |
Description
The
getCell
method (according to our docs) should return aHTMLTableCellElement
if the requested cell was rendered ornull
otherwise. In reality, it can also returnundefined
, which is not a desired behaviour.This situation occurs when we're trying to get a cell from a row which is rendered, but in a column which is not.
Steps to reproduce
Demo
https://jsfiddle.net/js_ziggle/zn3fLt5m/
The text was updated successfully, but these errors were encountered: