馃檵 Documentation Request
The interactive example at the top of https://react-spectrum.adobe.com/Tooltip exposes controls for placement, crossOffset, shouldFlip, and shouldCloseOnPress. The live preview responds correctly, but the generated code sample places these props on <Tooltip> rather than <TooltipTrigger>.
Setting placement to right produces:
<TooltipTrigger>
<ActionButton aria-label="Edit name"><Edit /></ActionButton>
<Tooltip placement="right">Edit name</Tooltip>
</TooltipTrigger>
Opening that in StackBlitz from the share menu fails to typecheck:
Type '{ children: string; placement: string; }' is not assignable to type 'IntrinsicAttributes & TooltipProps & RefAttributes<DOMRefValue<HTMLDivElement>>'.
Property 'placement' does not exist on type 'IntrinsicAttributes & TooltipProps & RefAttributes<DOMRefValue<HTMLDivElement>>'.(2322)
(property) placement: string
Reproduction: https://stackblitz.com/edit/8e1sdfwh?file=src%2FExample.tsx
All four props are declared on TooltipTriggerProps and explicitly omitted from TooltipProps in packages/@react-spectrum/s2/src/Tooltip.tsx. The API table further down the same page also lists children as Tooltip's only prop.
The cause looks like the /* PROPS */ marker in the first render block of packages/dev/s2-docs/pages/s2/Tooltip.mdx, which sits on <Tooltip> while the block declares docs={docs.exports.TooltipTrigger}. The second example on the same page has it on <TooltipTrigger {...props}/* PROPS */>.
Expected: the generated sample should read <TooltipTrigger placement="right"> and compile as written.
I'd be happy to open a PR for this.
馃Б Your Company/Team
personal
馃檵 Documentation Request
The interactive example at the top of https://react-spectrum.adobe.com/Tooltip exposes controls for
placement,crossOffset,shouldFlip, andshouldCloseOnPress. The live preview responds correctly, but the generated code sample places these props on<Tooltip>rather than<TooltipTrigger>.Setting placement to
rightproduces:Opening that in StackBlitz from the share menu fails to typecheck:
Reproduction: https://stackblitz.com/edit/8e1sdfwh?file=src%2FExample.tsx
All four props are declared on
TooltipTriggerPropsand explicitly omitted fromTooltipPropsinpackages/@react-spectrum/s2/src/Tooltip.tsx. The API table further down the same page also listschildrenasTooltip's only prop.The cause looks like the
/* PROPS */marker in the first render block ofpackages/dev/s2-docs/pages/s2/Tooltip.mdx, which sits on<Tooltip>while the block declaresdocs={docs.exports.TooltipTrigger}. The second example on the same page has it on<TooltipTrigger {...props}/* PROPS */>.Expected: the generated sample should read
<TooltipTrigger placement="right">and compile as written.I'd be happy to open a PR for this.
馃Б Your Company/Team
personal