mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Use display:none for CollapsibleButton's hidden panel
Using visibility:invisible is awkward due to the spacing it leaves when the panel is invisible. The CollapsibleParagraph behaves similarly, leaving no spacing behind when the paragraph is collapsed.
This commit is contained in:
parent
a9f0a46fbd
commit
2dba4d5156
@ -21,13 +21,13 @@ let CollapsibleButton = React.createClass({
|
||||
this.setState({expanded: !this.state.expanded});
|
||||
},
|
||||
render() {
|
||||
let isVisible = (this.state.expanded) ? '' : 'invisible';
|
||||
let isHidden = (this.state.expanded) ? '' : 'hidden';
|
||||
return (
|
||||
<span>
|
||||
<span onClick={this.handleToggle}>
|
||||
{this.props.button}
|
||||
</span>
|
||||
<div ref='panel' className={isVisible}>
|
||||
<div ref='panel' className={isHidden}>
|
||||
{this.props.panel}
|
||||
</div>
|
||||
</span>
|
||||
|
Loading…
Reference in New Issue
Block a user