Skip to content

Commit

Permalink
Fix that colorpicker shows up on click
Browse files Browse the repository at this point in the history
  • Loading branch information
EloB committed Sep 24, 2018
1 parent dd1953c commit ccfb1f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions addons/knobs/src/components/types/Color.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ class ColorType extends React.Component {
document.addEventListener('mousedown', this.handleWindowMouseDown);
}

shouldComponentUpdate(nextProps) {
shouldComponentUpdate(nextProps, nextState) {
const { knob } = this.props;
const { displayColorPicker } = this.state;

return nextProps.knob.value !== knob.value;
return (
nextProps.knob.value !== knob.value || nextState.displayColorPicker !== displayColorPicker
);
}

componentWillUnmount() {
Expand Down

0 comments on commit ccfb1f1

Please sign in to comment.