mirror of
https://github.com/chaoticbackup/chaoticbackup.github.io.git
synced 2026-03-21 17:24:14 -05:00
fix collaspible glitch
This commit is contained in:
parent
fd798e2dd4
commit
0c160a603b
File diff suppressed because one or more lines are too long
|
|
@ -351,17 +351,30 @@ export default class SearchCollection extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
function CollapsibleWrapper(props) {
|
||||
const {type, children, onClick, title, collapsed} = props;
|
||||
class CollapsibleWrapper extends React.Component {
|
||||
open = false;
|
||||
trigger = "";
|
||||
|
||||
return (
|
||||
<Collapsible
|
||||
trigger={title}
|
||||
open={collapsed[type]}
|
||||
onOpen={() => onClick(type)}
|
||||
onClose={() => onClick(type)}
|
||||
>
|
||||
{children}
|
||||
</Collapsible>
|
||||
);
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
const {collapsed, type} = props;
|
||||
this.open = collapsed[type];
|
||||
this.trigger = props.title;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {type, children, onClick} = this.props;
|
||||
|
||||
return (
|
||||
<Collapsible
|
||||
trigger={this.trigger}
|
||||
open={this.open}
|
||||
onOpen={() => onClick(type)}
|
||||
onClose={() => onClick(type)}
|
||||
>
|
||||
{children}
|
||||
</Collapsible>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user