From f92e60458765bf4cf1dd43ac1f192da69c947036 Mon Sep 17 00:00:00 2001 From: TAY TS Date: Tue, 15 Sep 2020 21:08:24 +0800 Subject: [PATCH 1/2] Allowed onClick prop in conjunction with href prop in EuiBadge --- src/components/badge/badge.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/badge/badge.tsx b/src/components/badge/badge.tsx index 524c2fce320..b8b02947439 100644 --- a/src/components/badge/badge.tsx +++ b/src/components/badge/badge.tsx @@ -229,7 +229,8 @@ export const EuiBadge: FunctionComponent = ({ relObj.href = href; relObj.target = target; relObj.rel = getSecureRelForTarget({ href, target, rel }); - } else if (onClick) { + } + if (onClick) { relObj.onClick = onClick; } From bd693afbdfa8770b9321f4e5054b2e0fec505f2c Mon Sep 17 00:00:00 2001 From: TAY TS Date: Tue, 15 Sep 2020 21:16:26 +0800 Subject: [PATCH 2/2] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8064c13efc1..581ac27bc47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Fixed z-index of `EuiBottomBar` to stay under header ([#4008](https://github.com/elastic/eui/pull/4008)) - Fixed regression of `EuiSelectable` not abiding by the `showIcons` prop ([#4008](https://github.com/elastic/eui/pull/4008)) - Fixed contrast of search input of `EuiSelectableTemplateSitewide` in dark header ([#4008](https://github.com/elastic/eui/pull/4008)) +- Allowed `onClick` prop when `href` prop is provided in `EuiBadge` ([#4035](https://github.com/elastic/eui/pull/4035)) **Breaking changes**