File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/lib/kit/components/ViewLayouts Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ export const ViewAccordeon = <T extends ArrayViewLayoutProps | ObjectViewLayoutP
1212 spec,
1313 children,
1414} : T ) : JSX . Element | null => {
15- const [ open , setOpen ] = React . useState ( true ) ;
15+ const [ open , setOpen ] = React . useState (
16+ _ . isBoolean ( spec . viewSpec . layoutOpen ) ? spec . viewSpec . layoutOpen : true ,
17+ ) ;
1618
1719 if ( ! isNotEmptyValue ( value , spec ) ) {
1820 return null ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ import _ from 'lodash' ;
4+
35import { Card } from '../' ;
46import { ArrayViewLayoutProps , ObjectViewLayoutProps } from '../../../core' ;
57import { isNotEmptyValue } from '../../utils' ;
@@ -10,7 +12,9 @@ export const ViewCardAccordeon = <T extends ArrayViewLayoutProps | ObjectViewLay
1012 spec,
1113 children,
1214} : T ) : JSX . Element | null => {
13- const [ open , setOpen ] = React . useState ( true ) ;
15+ const [ open , setOpen ] = React . useState (
16+ _ . isBoolean ( spec . viewSpec . layoutOpen ) ? spec . viewSpec . layoutOpen : true ,
17+ ) ;
1418
1519 const onToggle = React . useCallback ( ( ) => setOpen ( ( f ) => ! f ) , [ setOpen ] ) ;
1620
You can’t perform that action at this time.
0 commit comments