Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

fix(button): fix broken button clicks #83

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export const Button: React.FC<Props> = ({
}) => (
<ClassNames>
{({ cx, css }) => {
const onClick: Props["onClick"] = as.props.onClick;
const disabled: boolean =
as.props.disabled != null ? as.props.disabled : disabledProps;

Expand Down Expand Up @@ -439,8 +438,12 @@ export const Button: React.FC<Props> = ({
),
disabled,
onClick: (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
if (onClick) {
onClick(event);
if (otherProps.onClick) {
otherProps.onClick(event);
}

if (as.props.onClick) {
as.props.onClick(Event);
}

// We want to hide the blue border around a button after we've clicked
Expand Down