Skip to content

Commit

Permalink
fix(tag): pass props.disabled to close button (#5996)
Browse files Browse the repository at this point in the history
* fix(tag): pass props.disabled to close button

* fix(tag): un-nest disabled style

Co-authored-by: Josh Black <[email protected]>
Co-authored-by: Alessandra Davila <[email protected]>
  • Loading branch information
3 people authored May 13, 2020
1 parent 818705a commit 7f2d551
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/components/src/components/tag/_tag.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@
}
}

.#{$prefix}--tag--disabled .#{$prefix}--tag__close-icon {
cursor: not-allowed;
}

.#{$prefix}--tag__close-icon:focus {
outline: none;
box-shadow: inset 0 0 0 2px $focus;
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Tag/Tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ const Tag = ({
: `Clear filter ${children}`
}
id={tagId}
disabled={disabled}
{...other}>
<span className={`${prefix}--tag__label`}>
{children !== null && children !== undefined ? children : TYPES[type]}
</span>
<button
className={`${prefix}--tag__close-icon`}
onClick={handleClose}
disabled={disabled}
aria-labelledby={tagId}>
<Close16 />
</button>
Expand Down

0 comments on commit 7f2d551

Please sign in to comment.