From 4c31ac62de50d2409a3dd3829a46b4ca3790439f Mon Sep 17 00:00:00 2001 From: TJ Egan Date: Wed, 1 Sep 2021 22:49:01 +0200 Subject: [PATCH] fix(Tooltip): only callback parent onChange if it exists (#9558) Co-authored-by: Taylor Jones --- packages/react/src/components/Tooltip/Tooltip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/components/Tooltip/Tooltip.js b/packages/react/src/components/Tooltip/Tooltip.js index 04f1d995533a..751f13f6bb87 100644 --- a/packages/react/src/components/Tooltip/Tooltip.js +++ b/packages/react/src/components/Tooltip/Tooltip.js @@ -286,7 +286,7 @@ class Tooltip extends Component { } _handleUserInputOpenClose = (event, { open }) => { - if (this.isControlled) { + if (this.isControlled && this.props.onChange) { // Callback to the parent to let them decide what to do this.props.onChange(event, { open }); return;