marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.99k stars 5.25k forks source link

React Admin buttons don't trigger tooltips #10223

Open michel-paiva opened 1 month ago

michel-paiva commented 1 month ago

What you were expecting: When I wrap a React Admin custom button with a Tooltip, (for example CreateButton) I expect the Tooltip to be shown when I hover over it.

What happened instead:

The tooltip is not shown when hovering over a custom button wrapped by a Tooltip.

Steps to reproduce:

Related code:

Check the example where in the postListActions I have a CreateButton wrapped by a Tooltip and a material-ui here

Other information:

This wasn't introduced now, it seems like an existing issue. On material-ui doc they have this section talking about custom child components

Environment

fzaninotto commented 1 month ago

Thanks for the report. The problem comes from react-admin's <Button> and its derivatives (like <CreateButton>), which don't use forwardRef.

A PR to fix this is welcome.