react-tabtab icon indicating copy to clipboard operation
react-tabtab copied to clipboard

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

Open macrozone opened this issue 7 years ago • 2 comments

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 avatar Oct 24 '18 16:10 macrozone

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

macrozone avatar Oct 24 '18 16:10 macrozone

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

ctxhou avatar Oct 24 '18 19:10 ctxhou