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

fix: the page crash when Tabset component have only one Tab #1667

Closed
TahimiLeonBravo opened this issue Jun 28, 2020 · 3 comments · Fixed by #1671
Closed

fix: the page crash when Tabset component have only one Tab #1667

TahimiLeonBravo opened this issue Jun 28, 2020 · 3 comments · Fixed by #1671
Labels
1 coin bug Something isn't working

Comments

@TahimiLeonBravo
Copy link
Collaborator

TahimiLeonBravo commented Jun 28, 2020

Screen Shot 2020-06-28 at 12 27 36 PM

@TahimiLeonBravo TahimiLeonBravo added bug Something isn't working 1 coin labels Jun 28, 2020
@TahimiLeonBravo TahimiLeonBravo changed the title fix: Tabset component is broken when only one Tab is passed fix: the page crash when Tabset component have only one Tab Jun 28, 2020
@gerardolgvr
Copy link
Contributor

Hello! Can I try to fix this issue?

@TahimiLeonBravo
Copy link
Collaborator Author

Hello! Can I try to fix this issue?

@gerardolgvr You are welcome :)
Go for it!

gerardolgvr added a commit to gerardolgvr/react-rainbow that referenced this issue Jun 29, 2020
@gerardolgvr
Copy link
Contributor

gerardolgvr commented Jun 29, 2020

Hello! Can I try to fix this issue?

@gerardolgvr You are welcome :)
Go for it!

Thanks, I think I found the solution to this issue.

The problem was at the function "IsNotSameChildren" at utils.js. This function is expecting an array of objects but when a single tab is given the parameter that receives that function is an object. So, method .some is available for arrays but when an object is received an error occurs.

I have updated the function to check when an object is passed to the function to make the proper comparation.

The tests associated to this component runs without problems :)

I think its a good moment to make a pr and check if it seems ok for you or if some changes are required 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 coin bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants