Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EuiBadge] Support onClick & href #4530

Open
parkiino opened this issue Feb 16, 2021 · 2 comments
Open

[EuiBadge] Support onClick & href #4530

parkiino opened this issue Feb 16, 2021 · 2 comments

Comments

@parkiino
Copy link

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.

@chandlerprall
Copy link
Contributor

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

@cchaos
Copy link
Contributor

cchaos commented Feb 16, 2021

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

@cchaos cchaos changed the title [Bug] Support Eui Badge with OnClick & anchor [EuiBadge] Support OnClick & href Mar 19, 2021
@cchaos cchaos changed the title [EuiBadge] Support OnClick & href [EuiBadge] Support onClick & href Mar 19, 2021
@github-actions github-actions bot added the Stale label Oct 4, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@cee-chen cee-chen removed the Stale label Oct 14, 2024
@cee-chen cee-chen reopened this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants