-
Notifications
You must be signed in to change notification settings - Fork 174
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
chore: standardise forwardRefs across components #1748
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: f321c26 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +274 B (+0.09%) Total Size: 289 kB
ℹ️ View Unchanged
|
Looks good. It looks to me like some components still don't use forwardRef e.g. components/Alert/Alert.tsx Is that intentional or should all compos be set up with forward ref? |
@jhoward1994 As I mentioned, I tried to add |
const contentRef = React.useRef<HTMLDivElement>(null); | ||
const SimpleMenu = React.forwardRef<HTMLButtonElement, SimpleMenuProps>( | ||
({ children, onOpen, onClose, popoverPlacement, onReachEnd, ...props }, forwardedRef) => { | ||
const triggerRef = React.useRef<HTMLButtonElement>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is triggerRef used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its passed as a composedRef to MenuTrigger
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `main` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `main`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @strapi/[email protected] ### Minor Changes - [#1748](#1748) [`61936d6`](61936d6) Thanks [@madhurisandbhor](https://github.com/madhurisandbhor)! - chore: standardise forwardRefs across components ### Patch Changes - [#1738](#1738) [`8a87483`](8a87483) Thanks [@joshuaellis](https://github.com/joshuaellis)! - fix(IconButton): sizing was wrong compared to other buttons - [#1750](#1750) [`d89c9c3`](d89c9c3) Thanks [@madhurisandbhor](https://github.com/madhurisandbhor)! - Fixed: Link doesn't show the hover color - [#1753](#1753) [`9df216b`](9df216b) Thanks [@simotae14](https://github.com/simotae14)! - fixed Modal Content scroll issues - [#1752](#1752) [`90da62e`](90da62e) Thanks [@remidej](https://github.com/remidej)! - fixed SubNavHeader not applying space between label and search icon - [#1749](#1749) [`c7c5ad6`](c7c5ad6) Thanks [@madhurisandbhor](https://github.com/madhurisandbhor)! - fix: add click action on tag icon instead of on tag itself - Updated dependencies \[]: - @strapi/[email protected] ## @strapi/[email protected] ## @strapi/[email protected]
What does it do?
Standardising forwardRefs across components, so added forward refs to interactive and actionable components.
Why is it needed?
Currently, a lot of components don’t have forwardRef some do, and it applies to the input field of that component, some edge cases use imperativeHandle e.g. TextInput, realistically we should add forwardRef to all the components in some capacity, Ref.