eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiBadge] Support onClick & href

Open parkiino opened this issue 4 years ago • 2 comments

Type check fails when you have both an onClick prop and an href prop. Even if you are not using iconOnClick, if you have an href prop, type check requires iconOnClick and iconOnClickAriaLabel.

The EuiBadge type is inferred since type check knows it can't be an anchor because there's an onClick and it can't be a button because there's an anchor, so it must be the last type, which is iconOnClick+iconOnClickAriaLabel.

parkiino avatar Feb 16 '21 18:02 parkiino

@cchaos just to confirm, we want EuiBadge to work similarly to EuiButton and support both href & onClick props together?

chandlerprall avatar Feb 16 '21 18:02 chandlerprall

Yep, that's fine. I still like our ESLint warning, but we should still allow it for special cases.

cchaos avatar Feb 16 '21 18:02 cchaos

👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

github-actions[bot] avatar Sep 22 '25 00:09 github-actions[bot]