Skip to content

Add forwardRef to react-admin buttons to support tooltips#11122

Merged
djhi merged 2 commits intonextfrom
add-tooltip-forwardref-buttons
Jan 20, 2026
Merged

Add forwardRef to react-admin buttons to support tooltips#11122
djhi merged 2 commits intonextfrom
add-tooltip-forwardref-buttons

Conversation

@WiXSL
Copy link
Collaborator

@WiXSL WiXSL commented Jan 17, 2026

Implements #10223

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@WiXSL
Copy link
Collaborator Author

WiXSL commented Jan 17, 2026

  • Note on type changes:

Some of the buttons render a React Router Link (which becomes an <a>), while others render a real <button>.
I typed the refs accordingly:
CreateButton, EditButton, ShowButton, ListButton, CloneButton use component={Link} → ref is HTMLAnchorElement.
The rest render native buttons → ref is HTMLButtonElement
These changes avoid the TS errors of the first commit

  • Notes on test/stories:

I've only added one story and test for CreateButton since the changes are the same for every button.
If you want the same for every other one let me know

@djhi djhi merged commit fea04cb into next Jan 20, 2026
15 checks passed
@djhi djhi deleted the add-tooltip-forwardref-buttons branch January 20, 2026 10:41
@djhi djhi added this to the 5.14.0 milestone Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants