question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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>

Screenshot 2021-04-19 at 11 02 22 PM

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:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
maslianokcommented, Apr 27, 2021

@thanmaic fixed in v4.4.1

0reactions
maslianokcommented, May 7, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found