Skip to content

Commit

Permalink
Merge pull request #102 from openinfradev/bugfix-event-bubbling
Browse files Browse the repository at this point in the history
Bugfix. Stop event bubbling on button
  • Loading branch information
Siyeop authored May 6, 2024
2 parents d994b62 + bb2c04f commit d428b60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tksui-components",
"version": "0.6.19",
"version": "0.6.20",
"private": false,
"type": "module",
"module": "lib/esm/index.js",
Expand Down
6 changes: 6 additions & 0 deletions src/components/button/button/TButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ const TButton = forwardRef((props: TButtonProps, ref: Ref<TButtonRef>) => {
}
}, [props, ripple]);

const onClick = useCallback((event: MouseEvent) => {

event.stopPropagation();
}, []);

// endregion


Expand Down Expand Up @@ -140,6 +145,7 @@ const TButton = forwardRef((props: TButtonProps, ref: Ref<TButtonRef>) => {
onMouseLeave={onMouseLeave}
onKeyDown={onKeyDown}
onKeyUp={onKeyUp}
onClick={onClick}
disabled={props.disabled}
tabIndex={(props.disabled || props.loading) ? -1 : 0}
{...TooltipUtil.convertToTooltipAttributes(props)}
Expand Down

0 comments on commit d428b60

Please sign in to comment.