carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Tabs cannot be horizontally scrolled

Open liam-cochrane opened this issue 3 years ago • 10 comments

Current behaviour

When I have a Tabs component with more tabs on it than can be fit in the horizontal space that I have on the page, they overflow the bounds of what they are placed in. This can cause smaller devices to get a horizontal scrollbar or the tabs overhang unlike all other components on the page.

Expected behaviour

Material UI scrollable tabs can be horizontally scrolled by arrows, or when using a touch screen device may be swiped to scroll through them. Ant Design tabs shows a ... button when there are more tabs than can be fit on the screen, which drops down a list of all the tabs which can be picked from and can be swiped to scroll through them when on a touch screen device.

Reproducible example

https://codesandbox.io/s/vigorous-hooks-p91q7?file=/src/index.js This doesn't help to illustrate the problem so well since I am only using short 5 characters long "Tab x" titles to the tabs, so you really have to reduce your screen fairly small for it to be a problem with 10 tabs. But in a real environment with longer tab titles and no wrapping, it can really start to chug up some horizontal space.

Your environment

Software Version(s)
carbon-react all

liam-cochrane avatar May 27 '21 15:05 liam-cochrane

@harpalsingh - Is this a feature that UX would like to implement? If so, could UX provide designs please.

DipperTheDan avatar Jun 03 '21 09:06 DipperTheDan

Hi @harpalsingh do we have some more information about designs?

mmaciorowski-sage avatar Aug 10 '21 12:08 mmaciorowski-sage

@harpalsingh

mkrds avatar Sep 28 '21 12:09 mkrds

From the DS team: As far as I am aware this hasn't been requested by other products yet, so I'm afraid we can't advise on this as we haven't considered this topic yet. However it is possible that we will enhance Tabs for the rebrand, so please keep me in the loop with your research and conclusions.

clairedenning avatar Nov 09 '21 11:11 clairedenning

@clairedenning can you provide more information about when you will consider this?

DlgSHi avatar Nov 09 '21 14:11 DlgSHi

Sorry, not at the moment. We're still working on our roadmap

clairedenning avatar Nov 09 '21 15:11 clairedenning

@clairedenning has there been any update on this one?

samtjo avatar Feb 01 '22 14:02 samtjo

@clairedenning @harpalsingh are we okay with adding horizontal scroll to tabs or is this something we want to discourage? Looking at the DS docs there doesn't seem to be any guidance regarding this.

Parsium avatar May 31 '22 13:05 Parsium

We have been looking at this recently and have a ticket coming up to investigate solutions. An alternative suggestion from a product designer is a tab labelled "More" on the right, with options appearing below when you click on it.

clairedenning avatar May 31 '22 15:05 clairedenning

@benwilsonsage FYI - i know there's some SBS designers looking into this currently which could unblock this issue.

ljemmo avatar Jun 28 '22 16:06 ljemmo

Hi @ljemmo, looking at the DS docs for Tab it looks like this is still not supported. Are you aware of any findings the SBS designers you mentioned were able to get to?

Parsium avatar Oct 25 '22 15:10 Parsium

@Parsium i have a design from harpal now. We just need to review and implement in our figma library and ZH. The ticket number is FT-8.

ljemmo avatar Oct 26 '22 12:10 ljemmo

FE-5558

nicktitchmarsh avatar Dec 01 '22 13:12 nicktitchmarsh

This has been addressed in #5949 and released in v117.4.0

DipperTheDan avatar Apr 11 '23 10:04 DipperTheDan