提交 5d25a0b6 编写于 作者: G geraldglynn 提交者: kyle

improvement: add `isShown` check to <ModelCollapse />'s prop `expanded` logic (via #5331)

上级 96c444e8
......@@ -64,8 +64,9 @@ export default class Models extends Component {
const rawSchema = Map.isMap(rawSchemaValue) ? rawSchemaValue : Im.Map()
const displayName = schema.get("title") || rawSchema.get("title") || name
const isShown = layoutSelectors.isShown( ["models", name], false )
if(layoutSelectors.isShown(["models", name], false) && (schema.size === 0 && rawSchema.size > 0)) {
if( isShown && (schema.size === 0 && rawSchema.size > 0) ) {
// Firing an action in a container render is not great,
// but it works for now.
this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(), name])
......@@ -100,7 +101,7 @@ export default class Models extends Component {
displayName={displayName}
modelName={name}
hideSelfOnExpand={true}
expanded={defaultModelsExpandDepth > 1}
expanded={ defaultModelsExpandDepth > 0 && isShown }
>{content}</ModelCollapse>
</div>
}).toArray()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册