-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update react monorepo to v19 (major) #290
base: main
Are you sure you want to change the base?
Changes from 2 commits
c058910
221ff39
5a72048
7467376
0ea89f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,11 +106,10 @@ function ReleaseAnnouncementAnchor({ | |
children, | ||
context.getReferenceProps({ | ||
ref, | ||
...children.props, | ||
// If the ReleaseAnnouncement is open, we need manually aria-describedby. | ||
// The RA has the dialog role and it's not adding automatically the aria-describedby. | ||
...(context.open && { | ||
"aria-describedby": context.getFloatingProps().id, | ||
"aria-describedby": context.getFloatingProps().id as string, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
}), | ||
}), | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,12 +40,11 @@ import { | |
TooltipLabel, | ||
useTooltip, | ||
} from "./useTooltip"; | ||
import { XOR } from "ts-xor"; | ||
|
||
// Unfortunately Omit doesn't distribute nicely over sum types, so we have to | ||
// piece together the useTooltip options type by hand | ||
type TooltipProps = Omit<CommonUseTooltipProps, "isTriggerInteractive"> & | ||
XOR<TooltipLabel, TooltipDescription> & { | ||
(TooltipLabel | TooltipDescription) & { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
/** | ||
* Whether the trigger element is interactive. | ||
* When trigger is interactive: | ||
|
@@ -184,7 +183,7 @@ const TooltipAnchor: FC<TooltipAnchorProps> = ({ | |
if (!isValidElement(children)) return; | ||
|
||
if (isTriggerInteractive) { | ||
const props = context.getReferenceProps({ ref, ...children.props }); | ||
const props = context.getReferenceProps({ ref }); | ||
return cloneElement(children, props); | ||
} else { | ||
// For a non-interactive trigger, we want most of the props to go on the | ||
|
@@ -202,7 +201,7 @@ const TooltipAnchor: FC<TooltipAnchorProps> = ({ | |
} = props; | ||
return ( | ||
<span tabIndex={nonInteractiveTriggerTabIndex} {...spanProps}> | ||
{cloneElement(children as ReactElement, { | ||
{cloneElement(children as ReactElement<Record<string, unknown>>, { | ||
"aria-labelledby": labelId, | ||
"aria-describedby": descriptionId, | ||
})} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That file wasn't used |
This file was deleted.
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.
cloneElement
will anyway keep the existing props