Skip to content

Commit

Permalink
Fix: Gradient picker bug onToggle (#21732)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Apr 21, 2020
1 parent 0f1f5e7 commit 04cdf34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ export default function ControlPoints( {
) {
return;
}
onStartControlPointChange();
if ( isOpen ) {
onStopControlPointChange();
} else {
onStartControlPointChange();
}
onToggle();
} }
onMouseDown={ () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ function InsertPoint( {
<Button
aria-expanded={ isOpen }
onClick={ () => {
setAlreadyInsertedPoint( false );
onOpenInserter();
if ( isOpen ) {
onCloseInserter();
} else {
setAlreadyInsertedPoint( false );
onOpenInserter();
}
onToggle();
} }
className="components-custom-gradient-picker__insert-point"
Expand Down

0 comments on commit 04cdf34

Please sign in to comment.