Commit 05b0c04f authored by tom's avatar tom

fix tabs cut after API data is loaded

parent d5925ba9
...@@ -91,10 +91,12 @@ const TabsWithScroll = ({ ...@@ -91,10 +91,12 @@ const TabsWithScroll = ({
lazyBehavior={ lazyBehavior } lazyBehavior={ lazyBehavior }
> >
<AdaptiveTabsList <AdaptiveTabsList
// the easiest and most readable way to achieve correct tab's cut recalculation when screen is resized // the easiest and most readable way to achieve correct tab's cut recalculation when
// - screen is resized or
// - tabs list is changed when API data is loaded
// is to do full re-render of the tabs list // is to do full re-render of the tabs list
// so we use screenWidth as a key for the TabsList component // so we use screenWidth + tabIds as a key for the TabsList component
key={ screenWidth } key={ screenWidth + '_' + tabsList.map((tab) => tab.id).join(':') }
tabs={ tabs } tabs={ tabs }
tabListProps={ tabListProps } tabListProps={ tabListProps }
rightSlot={ rightSlot } rightSlot={ rightSlot }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment