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

if the last tab has been removed because of props update, it throws an error: TypeError: Cannot read property '__INTERNAL_NODE' of undefined #114

Open
macrozone opened this issue Oct 24, 2018 · 2 comments

Comments

@macrozone
Copy link

When the last tab gets removed, because of property updates (i create tabs by iterating over an array and then i remove an entry from the array), i get this error:

TypeError: Cannot read property '__INTERNAL_NODE' of undefined
    at TabListComponent.getTabNode (/node_modules/react-tabtab/lib/TabList.js:166:15)
    at TabListComponent.scrollToIndex (/node_modules/react-tabtab/lib/TabList.js:212:28)
    at TabListComponent.componentDidUpdate (/node_modules/react-tabtab/lib/TabList.js:147:14)
@macrozone
Copy link
Author

ok problem is, because after update, scrollToIndex does not respect array size. It should limit this.props.activeIndex to the bounds of the array

@ctxhou
Copy link
Owner

ctxhou commented Oct 24, 2018

cool, thanks for the bug report.
Could you help to fix this bug?

stefanuros added a commit to stefanuros/react-tabtab that referenced this issue Oct 30, 2019
matAlmeida pushed a commit to 4DevsO/react-tabtab that referenced this issue Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants