Skip to content

Commit

Permalink
Tag widget style fix: widget now hidden when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimon committed Mar 30, 2021
1 parent ce3a928 commit ec2fca7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
38 changes: 18 additions & 20 deletions src/editor/widgets/tag/TagWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,25 @@ const TagWidget = props => {

return (
<div className="r6o-widget r6o-tag">
<div>
{ tags.length > 0 &&
<ul className="r6o-taglist">
{ tags.map(tag =>
<li key={tag.value} onClick={toggle(tag.value)}>
<span className="r6o-label">{tag.value}</span>

{!props.readOnly &&
<CSSTransition in={showDelete === tag.value} timeout={200} classNames="r6o-delete">
<span className="r6o-delete-wrapper" onClick={onDelete(tag)}>
<span className="r6o-delete">
<CloseIcon width={12} />
</span>
{ tags.length > 0 &&
<ul className="r6o-taglist">
{ tags.map(tag =>
<li key={tag.value} onClick={toggle(tag.value)}>
<span className="r6o-label">{tag.value}</span>

{!props.readOnly &&
<CSSTransition in={showDelete === tag.value} timeout={200} classNames="r6o-delete">
<span className="r6o-delete-wrapper" onClick={onDelete(tag)}>
<span className="r6o-delete">
<CloseIcon width={12} />
</span>
</CSSTransition>
}
</li>
)}
</ul>
}
</div>
</span>
</CSSTransition>
}
</li>
)}
</ul>
}

{!props.readOnly &&
<Autocomplete
Expand Down
2 changes: 1 addition & 1 deletion themes/default/editor/widgets/tag/_tag.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.r6o-tags:empty {
.r6o-widget.r6o-tag:empty {
display:none;
}

Expand Down

0 comments on commit ec2fca7

Please sign in to comment.