-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][SpeedDialAction] Props id does not appear in HTML #36220
Comments
Thanks for the report. The SpeedDialAction follows the rules we have for forwarding extra props - it spreads them on the root element. However, in this case, the root element is a tooltip, and having these extra props on it is confusing and likely doesn't make sense. We can't change how it works currently without introducing a breaking change, but fortunately, there is a workaround you can use: the {actions.map((action) => (
<SpeedDialAction
key={action.name}
icon={action.icon}
tooltipTitle={action.name}
FabProps={{ id: action.id }}
/>
))} It sets its props on the button itself, so this should help you target the button. I'll add this to the v6 milestone, so we can consider redesigning the component in the next major version. |
Alright, I understand now why I couldn't see my IDs, thank you very much for your workaround, It does work perfectly indeed ! |
Let's leave the issue open, so we remember about this problem when designing the next version. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I see pros and cons with following the rule of forwarding extra props on the root element in @mnajdova @DiegoAndai, do you know if we have other components that break this rule? Or are there other components that have the same "problem" where the root element is not what it seems to be? |
After some discussions with the team, we decided to change the approach and we'll be forwarding props to the |
We can make the change in stages.
|
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: https://codesandbox.io/s/proud-water-fyxu9l?file=/src/App.js
Reproduce
Actual result
The IDs are not present in the html button components.
Expected result
See the IDs of the actions on the button components.
Current behavior 😯
We do not see the Ids on the button elements
Expected behavior 🤔
We should see the Ids
Context 🔦
I want to add some IDs on the actions so I can make some tests and query the actions by their IDs
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: