On Tabs removal or tabs addition the tabs component are wrapping without showing 'show more' icon
See original GitHub issue@maslianok @dcworldwide I still face the same issue even on the latest code. Please help resolve it. I am using the Tabs Removal example. But still face this issue of tabs wrapping to new line below instead of showing the ‘…’ .
onRemoveTab = (key, evt) => {
evt.stopPropagation();
// current tabs
const { items } = this.state;
// find index to remove
const indexToRemove = items.findIndex((tab) => tab.key === key);
// create a new array without [indexToRemove] item
const newTabs = [
...items.slice(0, indexToRemove),
...items.slice(indexToRemove + 1),
];
const nextSelectedIndex = newTabs[indexToRemove]
? indexToRemove
: indexToRemove - 1;
if (!newTabs[nextSelectedIndex]) {
alert("You can not delete the last tab!");
return;
}
this.setState({
items: newTabs,
selectedTabKey: newTabs[nextSelectedIndex].key,
});
};
getTabs = () => {
return dummyData.map((president, index) => ({
key: index,
title: president.name,
getContent: () => president.biography,
tabClassName: "tab-wrapper",
tabClassName: "tab",
panelClassName: "panel",
}));
};
<div className="itemRemoval__wrapper" style={{ marginTop: 120 }}>
<Tabs
items={this.state.items}
selectedTabKey={this.state.selectedTabKey}
allowRemove
removeActiveOnly
onRemove={this.onRemoveTab}
transform={false}
showMore={true}
uid={uniqueId()}
/>
</div>
What changes need to be done or any workaround for this issue?
I am using react: “^17.0.1” react-responsive-tabs: “^4.4.0” react-resize-detector: “^6.6.5”
I am testing on MacBook Chrome browser.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Show or hide object tabs - Microsoft Support
To close all the objects, right-click on a tab and select Close All. Select a tab to show the object. Tabs without Close...
Read more >Tabs - Lightning Design System
Tabs keeps related content in a single container that is shown and hidden through navigation. Item One; Item Two; Item Three. Item One...
Read more >Tabs | Components | Vaadin Docs
Tabs are used to organize and group content into sections that the user can navigate between. Open in a new tab. Show code....
Read more >react-tabs - npm
An accessible and easy tab component for ReactJS. Latest version: 6.0.0, last published: a month ago. Start using react-tabs in your project ...
Read more >Tabs - Adobe Spectrum
Key example showing tab item with and without an icon. ... of options: tab item#. From the design point of view, each component...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thanmaic fixed in v4.4.1
There is no simple answer. You’re trying to use the library in a way it was not designed to be used. And I have no manual on what you should do to directly inject it into your codebase.