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

CustomTabs value prop (or state).... Unable to automatically change the tabs #219

Closed
MrLuis opened this issue Apr 2, 2020 · 1 comment
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@MrLuis
Copy link

MrLuis commented Apr 2, 2020

Version

1.8.0

Reproduction link

https://jsfiddle.net/vu4cfqgo/

Operating System

MacOS

Device

MacPro

Browser & Version

Chrome 79? or 80

Steps to reproduce

  1. When using the regular MaterialUI tabs, I can use the 'value' to change to any specific tab. However, when switching to CustomTabs, I can't. I believe that is because it has its own internal value state. But not sure how to overcome this.

What is expected?

When changing the 'value', it should change the selected tab.

What is actually happening?

Nothing...


Solution

I'm not sure if there is a way to link 'value' and re-trigger the change request or to use a different stage/prop name (like ActiveTab, or something like that).

Additional comments

I couldn't make a sample, because I don't know how to include material there.

@einazare
Copy link
Contributor

einazare commented Apr 3, 2020

Hello there, @MrLuis ,

Thank you for your interest in working with our products.
As you can see in our live docs page about this component: https://demos.creative-tim.com/material-dashboard-pro-react/#/documentation/tabs
We do not offer the same functionality as Material-UI, and I think nor we will add it inside our product, and that is why what you are asking for is not working. Our customers are more than welcomed to add their own code and modify our components, they are templates since they can be changed based on your own needs.
To add your custom select code, please go inside src/components/CustomTabs/CustomTabs.js file, and at lines 21-24 you will see our code for the Tab selection, you should add your code there.
Also, at line 36, you can see how we set the active Tab as well.

I will leave this issue opened with the tag enhancement and will check with the Creative Tim board to see if we should add a default active tab property (i.e. line 21), and a custom selection function (i.e., stop triggering our own function (line 37) and trigger a function that comes as a property.

Best,
Manu

@einazare einazare added enhancement New feature or request help wanted Extra attention is needed labels Apr 3, 2020
@einazare einazare changed the title [Bug] CustomTabs value prop (or state).... Unable to automatically change the tabs CustomTabs value prop (or state).... Unable to automatically change the tabs Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants