Skip to content

Commit

Permalink
Merge pull request #2297 from Autodesk/fix/icon-button
Browse files Browse the repository at this point in the history
fix: do not trigger focus/hover/pressed states when disabled
  • Loading branch information
wmui51 authored Sep 21, 2020
2 parents d05bd7f + 19ab026 commit 5528e35
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/icon-button/src/IconButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class IconButton extends Component {

render() {
const {
disabled,
onBlur,
onFocus,
onMouseDown,
Expand Down Expand Up @@ -107,9 +108,10 @@ export default class IconButton extends Component {
onMouseUp: handleMouseUp
}) => (
<IconButtonPresenter
hasFocus={hasFocus}
hasHover={hasHover}
isPressed={isPressed}
disabled={disabled}
hasFocus={hasFocus && !disabled}
hasHover={hasHover && !disabled}
isPressed={isPressed && !disabled}
onBlur={handleBlur}
onFocus={handleFocus}
onMouseDown={handleMouseDown}
Expand Down

0 comments on commit 5528e35

Please sign in to comment.