Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

fix(Accordion|Dropdown): fix default props in auto controlled mode#675

Merged
layershifter merged 8 commits intomasterfrom
fix/acc-accordion-dropdown
Jan 9, 2019
Merged

fix(Accordion|Dropdown): fix default props in auto controlled mode#675
layershifter merged 8 commits intomasterfrom
fix/acc-accordion-dropdown

Conversation

@layershifter
Copy link
Member

Fixes #610.

state: any = { activeIndex: [0] }

getInitialAutoControlledState({ exclusive }) {
return { activeIndex: exclusive ? -1 : [-1] }
Copy link
Member Author

Choose a reason for hiding this comment

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

This line didn't work previously, that's why we have visual regressions there.

Copy link
Contributor

Choose a reason for hiding this comment

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

To me it seems, according to the changes in screener that that line was indeed working:
image
as the previous accepted screen has the first element inside active. Not quite sure how did you conclude that it was not working before.. Maybe I am missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that this is part of the autocontroll props and should not be initialized, but can't understand why do you say it was not working previously

@layershifter layershifter changed the title fix(Accordion|Dropdown): fix broken state fix(Accordion|Dropdown): fix default props in auto controlled mode Jan 3, 2019
@layershifter layershifter force-pushed the fix/acc-accordion-dropdown branch from 868753a to ce65f1c Compare January 9, 2019 15:14
@layershifter layershifter merged commit 6cbc10a into master Jan 9, 2019
@layershifter layershifter deleted the fix/acc-accordion-dropdown branch January 9, 2019 15:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🧰 fix Introduces fix for broken behavior. 🚀 ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants