Closed joepuzzo closed 1 year ago
I don't see that as a prop we support for ActionButtons https://react-spectrum.adobe.com/react-spectrum/ActionButton.html#props where are you getting that it should? Or why do you need it?
Action button is a button. Therefore it should allow any native DOM prop ( title being one of them )
If you dont support this then you will never be able to hover over an icon button and see what it does. ( as an example )
That's what TooltipTrigger is for https://react-spectrum.adobe.com/react-spectrum/Tooltip.html
This covers a few problems that native titles have. One, a keyboard user will never see it https://jsfiddle.net/a6zk7jce/. And two, VoiceOver frequently doesn't read titles.
Neither of them addresses touch users, though, so it's still recommended not to use tooltips. It's better to use ContextualHelp https://react-spectrum.adobe.com/react-spectrum/ContextualHelp.html where it makes sense.
You can also use an aria-label
(which VO will read) or use an internationalized label and not rely on an icon alone.
Ahh ok I will use tooltip then thanks!
PS. Would be super cool if I could open a tooltip on an Alert Icon ( Or any Icon ) without it also having to be a button.
PS. Would be super cool if I could open a tooltip on an Alert Icon ( Or any Icon ) without it also having to be a button.
This is also intentional. The target must be focusable so that keyboard navigation can reach it. We are working to expand the definition of focusable, but it wouldn't be expanded to just an Icon.
Ok cool thanks so much for your help!
🐛 Bug Report
In the below case the
title
prop will not end up on the button.This is using the latest version 3.24.1