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
[Tooltip][Joy] Fix arrow does not appear #35473
Conversation
@@ -4,7 +4,7 @@ import Tooltip from '@mui/joy/Tooltip'; | |||
|
|||
export default function ArrowTooltips() { | |||
return ( | |||
<Tooltip title="Add" arrow> | |||
<Tooltip title="Add" arrow open placement="right"> |
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.
This visual regression will help us preventing the regression in the future.
// @ts-ignore `ref` is required for the 'root' slot | ||
useForkRef(resolvedComponentsProps?.ref, name === 'root' ? parameters.ref : undefined), | ||
) as ((instance: any | null) => void) | null; | ||
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.ref); |
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.
useForkRef
can receive ...refs
, no need to double it.
parameters: (T extends 'root' ? { ref: React.ForwardedRef<any> } : {}) & { | ||
parameters: (T extends 'root' // root slot must pass a `ref` as a parameter | ||
? { ref: React.ForwardedRef<any> } | ||
: { ref?: React.ForwardedRef<any> }) & { |
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.
This allows the non-root slot to pass in ref
directly.
|
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.
Looks good 👍
close #35472
Root cause
The
ref
inadditionalProps
is not called byuseSlot
soarrowRef
is always null.Argos
change is expected.