-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Tablist not scrolling properly after adding tabs #16801
Comments
Hi @wood-doug, could you please reproduce your issue in a sandbox environment? We have a repository containing pre-configured sandboxes for different versions of |
From: Gururaj J ***@***.***>
Sent: Thursday, June 20, 2024 7:22 AM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
Hi @wood-doug <https://github.com/wood-doug> , could you please reproduce your issue in a sandbox environment? We have a repository <https://github.com/carbon-design-system/sandboxes/blob/main/README.md> containing pre-configured sandboxes for different versions of @carbon/react. Please use the sandbox that matches the version you're experiencing the issue with. This will help us better understand and debug the problem you're facing. Let me know if you need any assistance with setting up the sandbox.
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQP4SBARC5JDDX7FUPLZIK3LZAVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQGQZTEMZSGM> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQMMWXGUHT4PCKCVZVTZIK3LZA5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUB63A4G.gif> Message ID: ***@***.*** ***@***.***> >
|
Hey @wood-doug , As mentioned could you please reproduce your issue in a sandbox environment? We have a repository containing pre-configured sandboxes for different versions of @carbon/react. Please use the sandbox that matches the version you're experiencing the issue with. This will help us better understand and debug the problem you're facing. Let me know if you need any assistance with setting up the sandbox. Your comment looks like its missing that sandbox link. |
I sent you a perfectly good zip with a small piece of code that demonstrates the issue.
From: Preeti Bansal ***@***.***>
Sent: Monday, June 24, 2024 11:16 AM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
From: Gururaj J @.> Sent: Thursday, June 20, 2024 7:22 AM To: carbon-design-system/carbon @.> Cc: Doug Wood @.>; Mention @.> Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801 <#16801> ) Hi @wood-doug <https://github.com/wood-doug> https://github.com/wood-doug , could you please reproduce your issue in a sandbox environment? We have a repository https://github.com/carbon-design-system/sandboxes/blob/main/README.md containing pre-configured sandboxes for different versions of @carbon/react. Please use the sandbox that matches the version you're experiencing the issue with. This will help us better understand and debug the problem you're facing. Let me know if you need any assistance with setting up the sandbox. — Reply to this email directly, view it on GitHub <#16801 (comment) <#16801 (comment)> > , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGVNOQP4SBARC5JDDX7FUPLZIK3LZAVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQGQZTEMZSGM . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AGVNOQMMWXGUHT4PCKCVZVTZIK3LZA5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUB63A4G.gif Message ID: @.*** @.***> >
Hey @wood-doug <https://github.com/wood-doug> , As mentioned could you please reproduce your issue in a sandbox environment? We have a repository <https://github.com/carbon-design-system/sandboxes/blob/main/README.md> containing pre-configured sandboxes for different versions of @carbon/react. Please use the sandbox that matches the version you're experiencing the issue with. This will help us better understand and debug the problem you're facing. Let me know if you need any assistance with setting up the sandbox. Your comment looks like its missing that sandbox link.
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQOZXEKQ5HE4USK5TO3ZJAZ3JAVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBWHAZDANRZGU> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQP7NBDSGFQ3N2IQXU3ZJAZ3JA5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUCLA6FO.gif> Message ID: ***@***.*** ***@***.***> >
|
Hey @wood-doug. Thanks for drumming up this bug report for the Tabs component. Our engineers work tirelessly to expand on the design system while at the same time devoting time out of their sprint to squash bugs, like the one you've identified along the way. To that end, it will help expedite your request tremendously by creating a reproduction in sandbox like stackblitz. Thank you for your help! |
I’ve never used sandbox. I sent you a concise zip that you can run with npm start.
Here it is again
And please use my internal email for further correspondence: ***@***.***
From: Scott Strubberg ***@***.***>
Sent: Thursday, July 11, 2024 10:01 AM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
Hey @wood-doug <https://github.com/wood-doug> . Thanks for drumming up this bug report for the Tabs component. Our engineers work tirelessly to expand on the design system while at the same time devoting time out of their sprint to squash bugs, like the one you've identified along the way. To that end, it will help expedite your request tremendously by creating a reproduction in sandbox like stackblitz <https://stackblitz.com/github/carbon-design-system/carbon/tree/main/examples/vite?file=src%2FApp.jsx> . Thank you for your help!
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQIBJZWQZNJ7IT24AIDZL2FZPAVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRTGAYTQOJTG4> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQPFUZLCF42PW4DOZBTZL2FZPA5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUEQCJ3S.gif> Message ID: ***@***.*** ***@***.***> >
|
@wood-doug I believe when you reply via email to an issue it does not include the attachments you may have attached to the email. There is no .zip on this issue thread. We ask that you provide a live sandbox example so that we can quickly review and diagnose your issue. |
I sent you a box link
From: Taylor Jones ***@***.***>
Sent: Monday, July 15, 2024 10:32 AM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
@wood-doug <https://github.com/wood-doug> I believe when you reply via email to an issue it does not include the attachments you may have attached to the email. There is no .zip on this issue thread. We ask that you provide a live sandbox example so that we can quickly review and diagnose your issue.
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQKCAUG2I4IR2DS2YR3ZMPMOXAVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRYGY2DSMRZGA> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQKLBRCKUSP4ZCWMLW3ZMPMOXA5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUE2Z6UU.gif> Message ID: ***@***.*** ***@***.***> >
|
@wood-doug There is not a box link on this issue |
Just write me at me internal email or slack me and I’ll give you the zip
From: Taylor Jones ***@***.***>
Sent: Wednesday, July 17, 2024 9:08 AM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
@wood-doug <https://github.com/wood-doug> There is not a box link on this issue
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQMODEPFJIIBFWIRI2TZMZUB5AVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZTGI4DEMRXHA> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQOPPRRWVEHSPT5R2DLZMZUB5A5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUFDUXOM.gif> Message ID: ***@***.*** ***@***.***> >
|
@wood-doug I quickly put together a stackblitz example of what you've described. I see the left arrow button not showing like it should. Is this what you're seeing? |
There are three issues, tow of which you have other tickets for:
* Forward and back arrows not showing – known
* If the tab container is resized, and the tabs require scrolling, they don’t scroll properly – know sort of.
* If tabs are added to the container dynamically after it is created, and the addition cause the tabs to need to scroll, they don’t scroll properly
For the second issue, you need to hook the resize event and recalculate scrolling.
For my issues, you need to recalculate the scrolling when a tab is added, not just on ComponetDidMount/State Hook execute once.
From: Taylor Jones ***@***.***>
Sent: Wednesday, July 17, 2024 5:10 PM
To: carbon-design-system/carbon ***@***.***>
Cc: Doug Wood ***@***.***>; Mention ***@***.***>
Subject: Re: [carbon-design-system/carbon] [Bug]: Tablist not scrolling properly after adding tabs (Issue #16801)
@wood-doug <https://github.com/wood-doug> I quickly put together a stackblitz example <https://stackblitz.com/edit/github-bmdhlt?file=src%2FApp.jsx> of what you've described. I see the left arrow button not showing like it should. Is this what you're seeing?
—
Reply to this email directly, view it on GitHub <#16801 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AGVNOQP2XH55UI6TIBKOCJDZM3MR7AVCNFSM6AAAAABJOERUHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZUGMYDCNJSGY> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AGVNOQKA5FPGW23ZZG7RQG3ZM3MR7A5CNFSM6AAAAABJOERUHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUFFS6FM.gif> Message ID: ***@***.*** ***@***.***> >
|
Package
@carbon/react
Browser
Chrome, Safari, Firefox, Edge
Package version
1.58.1
React version
18
Description
When I start with a tablist that does not require scrolling and add tabs so scrolling is required, it does not scroll correctly. This is similar to issue #11783 in that the scrolling is not recalculating when it should
Reproduction/example
import React from "react"; import './App.css'; import { Button } from "@carbon/react"; import TabsSet from "./TabsSet" export default class App extends React.PureComponent { constructor( props ) { super( props ); this.tabs = [ { title: "Green Tab", panel: <div style={ { backgroundColor: "#D0F0D0" } }> Green Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "Blue Tab", panel: <div style={ { backgroundColor: "#D0D0F0" } }> Blue Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "Purple Tab", panel: <div style={ { backgroundColor: "#F0D0F0" } }> Purple Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "Red Tab", panel: <div style={ { backgroundColor: "#F0D0D0" } }> Red Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "Amber Tab", panel: <div style={ { backgroundColor: "#F0F0D0" } }> Amber Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "Gray Tab", panel: <div style={ { backgroundColor: "#D0D0D0" } }> Gray Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, { title: "White Tab", panel: <div style={ { backgroundColor: "#FFFFFF" } }> White Panel , panelClass: "sideTabPanel", tabClass: "sideTabLabel", }, ] this.state = { tabList: [ ], nextIndex: 0, }; } render() { const tabSetProps = { tabList: this.state.tabList, }; const addTabButton = { disabled: this.state.nextIndex >= this.tabs.length, kind: "secondary", size: "md", onClick: () => this.handleAddTab(), }; return
tabs_panel
); return classnames( names ); } renderTabs() { let key = 1; return this.props.tabList.map( ( item ) => { const tabProps = { className: item.tabClass, } if( item.icon ) tabProps.renderIcon = item.icon; return <Tab key={ key++ } { ...tabProps }> { item.title } } ); } renderPanels() { let key = 1; return this.props.tabList.map( ( item ) => { return <TabPanel key={ key++ } className={ item.panelClass } > { item.panel } } ); } render() { if( !this.props.tabList ) return; if( this.props.tabList.$$typeof === "Symbol(react.element)") { return this.props.tabList; } if( !Array.isArray( this.props.tabList ) ) { return this.props.tabList.panel; } const tabListProps = { fullWidth: true, scrollIntoView: true, } return <div className={ this.getClassName() }> <Tabs scrollIntoView="true" className={ this.props.tabsClass } > <TabList { ...tabListProps }> { this.renderTabs() } <TabPanels className={ this.props.contentClass }> { this.renderPanels() } } }Steps to reproduce
Create a tab list with few enough tabs that they display properly, the through user interaction, add one or more tabs to exceed the tablist size
Suggested Severity
None
Application/PAL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: