Skip to content
This repository has been 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
merged 8 commits into from
Jan 9, 2019

Conversation

layershifter
Copy link
Member

Fixes #610.

@@ -118,8 +118,6 @@ class Accordion extends AutoControlledComponent<ReactProps<AccordionProps>, any>
static Title = AccordionTitle
static Content = AccordionContent

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
@alinais alinais added this to layershifter in Core Team Jan 7, 2019
@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
No open projects
Core Team
  
layershifter
Development

Successfully merging this pull request may close these issues.

None yet

2 participants