carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

Button with icon only - always shows tooltip #1882

Closed Sahasrara closed 10 months ago

Sahasrara commented 10 months ago

There seems to be no way to disable the tooltip for buttons that only have an icon. I figured it might be a bug, so I opened this ticket. Feel free to close it if this is by design.

brunnerh commented 10 months ago

If there is no label, the tooltip is required for accessibility.

Spec:

Icon-only buttons, which do not persistently display a text label, expose their label on hover and focus.

metonym commented 10 months ago

@brunnerh is exactly correct. See also the upstream Carbon issue, in which this is an intentional implementation.

Although not recommended for accessibility reasons, if you must hide the tooltip, you can add custom CSS to achieve this. See https://github.com/carbon-design-system/carbon-components-svelte/discussions/1483#discussioncomment-3586643