Skip to content

Commit 4a95fb7

Browse files
Alessandra Davilakodiakhq[bot]
andauthored
fix(button): remove tooltip on click on button in and tooltip icon (#9882)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent a9c13ff commit 4a95fb7

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

packages/react/src/components/Button/Button.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const Button = React.forwardRef(function Button(
106106

107107
const handleClick = (evt) => {
108108
// Prevent clicks on the tooltip from triggering the button click event
109+
setAllowTooltipVisibility(false);
109110
if (evt.target === tooltipRef.current) {
110111
evt.preventDefault();
111112
return;

packages/react/src/components/TooltipIcon/TooltipIcon.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ const TooltipIcon = ({
9898
};
9999

100100
const handleClick = (evt) => {
101+
setAllowTooltipVisibility(false);
101102
// Prevent clicks on the tooltip from triggering the button click event
102103
if (evt.target === tooltipRef.current) {
103104
evt.preventDefault();

0 commit comments

Comments
 (0)