File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/core/plugins/oas31/components/models Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,12 @@ const Models = ({
3030 * Effects.
3131 */
3232 useEffect ( ( ) => {
33- const isOpenAndExpanded = isOpen && defaultModelsExpandDepth > 1
33+ const includesExpandedSchema = Object . entries ( schemas ) . some (
34+ ( [ schemaName ] ) =>
35+ layoutSelectors . isShown ( [ ...schemasPath , schemaName ] , false )
36+ )
37+ const isOpenAndExpanded =
38+ isOpen && ( defaultModelsExpandDepth > 1 || includesExpandedSchema )
3439 const isResolved = specSelectors . specResolvedSubtree ( schemasPath ) != null
3540 if ( isOpenAndExpanded && ! isResolved ) {
3641 specActions . requestResolvedSubtree ( schemasPath )
@@ -55,12 +60,15 @@ const Models = ({
5560 }
5661 }
5762 const handleJSONSchema202012Expand = ( schemaName ) => ( e , expanded ) => {
63+ const schemaPath = [ ...schemasPath , schemaName ]
5864 if ( expanded ) {
59- const schemaPath = [ ...schemasPath , schemaName ]
6065 const isResolved = specSelectors . specResolvedSubtree ( schemaPath ) != null
6166 if ( ! isResolved ) {
6267 specActions . requestResolvedSubtree ( [ ...schemasPath , schemaName ] )
6368 }
69+ layoutActions . show ( schemaPath , true )
70+ } else {
71+ layoutActions . show ( schemaPath , false )
6472 }
6573 }
6674
You can’t perform that action at this time.
0 commit comments