dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

Tabs Component should show Horizontal scroller if tabs go out of view of the container #1681

Closed diwakarang closed 7 months ago

diwakarang commented 1 year ago

Describe the bug Tabs Component does not show horizontal scrollers. Also, In certain cases, pdf names are hidden by misaligned text.

To Reproduce

  1. Visit Halstack component website, and add following values to list of tabs

    
    
     [
          {
            label: "Customer Journey V2 Jan 2023.pdf",
          },
          {
            label: "Market Compensation Levels Report Q1 2023.pdf",
          },
          {
            label: "Market Reform Contract",
          },
          {
            label: "Market Reform Proposal",
          }
     ] 


2. If above values are not used, ensure, tabs contain three or more tab labels with lengthy text values.
3. During initial load, it can be observed, horiztonal scroller buttons to scroll the tabs are not present.
4. Resize the window(using any method, say, change window size , fullscreen and exit fullscreen, dev tools, etc)
5. After resize the scrolls are visible.
6. Horizontal Scrollers should be visible in first place, but visible only after a resize event is fired. This seems to a bug. 

**Expected behaviour**
1. User need to be aware if there are more tabs present, apart from the ones that are in view. 
2. User should be able to access horizontal scroll buttons to scroll between the tabs in all cases

**Screenshots**

**Without Scroll**
<img width="953" alt="image" src="https://github.com/dxc-technology/halstack-react/assets/42486284/63c172d3-cca1-45fa-99aa-d2ab75efa948">

**With Scroll after fullscreen**
<img width="557" alt="image" src="https://github.com/dxc-technology/halstack-react/assets/42486284/a9ba29c3-3798-4a54-9a71-feab682a8647">

**First Tab Name difficult to view**
![image](https://github.com/dxc-technology/halstack-react/assets/42486284/c6f22683-38ea-4dd1-9c5d-1c712401fa6a)

**Additional context**
Most of the time, after resize event occurs in the window, scrollers are visible. 

**Add labels**
Tabs, DxcTabs