fix: 修复折叠器中有 select 或输入框时点击也折叠问题 (#2781)

This commit is contained in:
吴多益 2021-10-28 17:37:00 +08:00 committed by GitHub
parent ad3ab14d09
commit adef8e0595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ import {
SchemaCollection,
SchemaTpl
} from '../Schema';
import {isClickOnInput} from '../utils/helper';
/**
* Collapse
@ -134,7 +135,10 @@ export default class Collapse extends React.Component<
}
}
toggleCollapsed() {
toggleCollapsed(e: React.MouseEvent<HTMLElement>) {
if (isClickOnInput(e)) {
return;
}
this.props.collapsable !== false &&
this.setState({
collapsed: !this.state.collapsed