Skip to content
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

feat(Tabs): create scrollable Tabs variant #6928

Conversation

emyarod
Copy link
Member

@emyarod emyarod commented Sep 29, 2020

Closes #6798
Ref #4758

This PR namespaces the styles and adds conditionals throughout the Tabs methods and props to support compatibility for both scrollable and non-scrollable/dropdown Tabs variants

Changelog

New

  • namespaced styles for nonscrollable/dropdown and scrollable variants
  • scrollable prop to toggle scrollable Tabs variant

Changed

  • add deprecation notices throughout the component, styles, tests, and stories

Testing / Reviewing

Ensure the scrollable and dropdown/non-scrollable tabs function as expected (for scrollable refer to current stable storybook, and for dropdown/non-scrollable refer to a Carbon version prior to #6410)

@netlify
Copy link

netlify bot commented Sep 29, 2020

Deploy preview for carbon-elements ready!

Built with commit 1fc08bc

https://deploy-preview-6928--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Sep 29, 2020

Deploy preview for carbon-components-react ready!

Built with commit 1fc08bc

https://deploy-preview-6928--carbon-components-react.netlify.app

Copy link
Contributor

@cal-smith cal-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey 👋 I've been watching the progress on this issue, and would like to help where I can to get this released as soon as possible. We have a number of consumers that would like to update to a newer carbon-components release and this is currently blocking them from that.

packages/components/src/components/tabs/_tabs.scss Outdated Show resolved Hide resolved
@emyarod emyarod requested a review from cal-smith September 29, 2020 17:43
@tw15egan
Copy link
Collaborator

Awesome work getting this up, just noticed a small style issue on the scrollable version in Safari while reviewing.

Screen Shot 2020-09-29 at 10 48 09 AM

Also noticed some focus issues with the Dropdown variant, but those were present before the scrollable tabs implementation so that can be fixed in another PR. I don't want to hold this fix up 👍

Copy link
Contributor

@cal-smith cal-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on the compatibility front! Thanks for getting this sorted! 😁

@joshblack
Copy link
Contributor

Do we need to offer backwards-compat in the React code? It seems like the styles should be sufficient and then we wouldn't need to add conditions for scrollable in several places for Tabs/Tab that will need to be removed.

@emyarod
Copy link
Member Author

emyarod commented Sep 29, 2020

yeah we need to add conditions because the internal component method signatures are changed for the scrollable variant. I don't believe that styles are sufficient to switch between the dropdown and scrollable tab behavior. and I also think it would be best not to call any methods associated with scrollable tabs when the dropdown tabs are being used (or vice versa)

@emyarod
Copy link
Member Author

emyarod commented Sep 29, 2020

image

@tw15egan I'm not seeing that issue in Safari, can you add some more details about how I might be able to replicate that bug?

@tw15egan
Copy link
Collaborator

Eh, I'm running the MacOS Big Sur beta and noticed an issue that was fixed in a different issue on the new Safari 14.0.0 but was present on Safari 13.1.2. Chalking it up to that 👍

@joshblack
Copy link
Contributor

I think what I'm not understanding is why this needs to be a variant on the React component side. It seemed like the React component should just use the new styles and shouldn't introduce a variant because the scrollable work is the new default for Tabs.

The issue with replacing the styles was that it broke framework implementations, so it seemed like if we had both styles that it would solve that issue for them but then in the React implementation we just use the new styles by default and not worry about adding a variant.

@emyarod
Copy link
Member Author

emyarod commented Sep 30, 2020

oh I see so we make no changes to our JS and just scope the styles? I guess having the component changes was useful for regression testing but I can remove the backwards compatibility in the JS

@joshblack
Copy link
Contributor

@emyarod yeah! Exactly, I think that's all that we need to do to fix for framework implementations 👀

@emyarod emyarod force-pushed the 6798-create-scrollable-tabs-variant branch from 8b6ef10 to 1fc08bc Compare September 30, 2020 21:19
@kodiakhq kodiakhq bot merged commit 2c4985c into carbon-design-system:master Sep 30, 2020
@cal-smith
Copy link
Contributor

Thanks all!

@tw15egan
Copy link
Collaborator

tw15egan commented Oct 1, 2020

@cal-smith pushed up an rc-1, can you verify this resolves your issue?

@cal-smith
Copy link
Contributor

@tw15egan just checked it out, looks like everything is sorted!

@emyarod emyarod deleted the 6798-create-scrollable-tabs-variant branch June 10, 2021 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10.19 broke tab styles
4 participants