Skip to content

Commit

Permalink
Merge pull request #1578 from mcandu/empty-fieldset
Browse files Browse the repository at this point in the history
Fixed - Fieldset shows empty legend over its border
  • Loading branch information
mcandu authored Mar 30, 2021
2 parents 3184974 + b99cc6b commit ab7d385
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/fieldset/Fieldset.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,13 @@ export class Fieldset extends Component {

renderLegend(collapsed) {
const legendContent = this.renderLegendContent(collapsed);

return (
<legend className="p-fieldset-legend p-unselectable-text" onClick={this.toggle}>
{legendContent}
</legend>
);
if (this.props.legend != null || this.props.toggleable) {
return (
<legend className="p-fieldset-legend p-unselectable-text" onClick={this.toggle}>
{legendContent}
</legend>
);
}
}

render() {
Expand Down

0 comments on commit ab7d385

Please sign in to comment.