File tree Expand file tree Collapse file tree
src/components/core/filters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ type State = {
1313
1414export default class FilterGroup extends Component {
1515 props : FilterGroupProps ;
16- state : State = { expanded : false } ;
16+ state : State = { expanded : this . props . initiallyExpanded } ;
1717
1818 selectedCount = ( ) => {
1919 const { values = [ ] } = this . props ;
@@ -23,10 +23,6 @@ export default class FilterGroup extends Component {
2323 } , 0 ) ;
2424 } ;
2525
26- getExpandedState = ( ) => {
27- return this . props . initialyExpanded ? ! this . state . expanded : this . state . expanded ;
28- }
29-
3026 toggleExpansion = ( ) => this . setState ( { expanded : ! this . state . expanded } ) ;
3127
3228 render ( ) {
@@ -35,7 +31,7 @@ export default class FilterGroup extends Component {
3531 onClearFacet = ( ) => { } ,
3632 onSelectFacet = ( ) => { } ,
3733 } = this . props ;
38- const expanded = this . getExpandedState ( ) ;
34+ const { expanded } = this . state ;
3935
4036 const updatedChildren = React . Children . map ( children , ( child ) => {
4137 return React . cloneElement ( child , { onSelectFacet, term, values } ) ;
You can’t perform that action at this time.
0 commit comments