diff --git a/src/components/forms/context/Form/Form.tsx b/src/components/forms/context/Form/Form.tsx index d833c79..0563726 100644 --- a/src/components/forms/context/Form/Form.tsx +++ b/src/components/forms/context/Form/Form.tsx @@ -37,7 +37,7 @@ export const Form = (props: FormProps) => { const { unstyled = false, nestable, children, className, ...propsRest } = props; const formId = React.useId(); - const [wrapperRef, setWrapperRef] = React.useState>(null); + const [wrapperRef, setWrapperRef] = React.useState>(null); // Memoize to keep a stable reference const context: FormContext = React.useMemo(() => ({ formId }), [formId]); diff --git a/src/components/forms/context/Form/FormOptics.tsx b/src/components/forms/context/Form/FormOptics.tsx index 911ecfe..7649346 100644 --- a/src/components/forms/context/Form/FormOptics.tsx +++ b/src/components/forms/context/Form/FormOptics.tsx @@ -40,7 +40,7 @@ export const Form = (props: FormProps) => { const { unstyled = false, nestable, children, className, ...propsRest } = props; const formId = React.useId(); - const [wrapperRef, setWrapperRef] = React.useState>(null); + const [wrapperRef, setWrapperRef] = React.useState>(null); // Memoize to keep a stable reference const context: FormContext = React.useMemo(() => ({ formId }), [formId]); diff --git a/src/components/forms/controls/Select/Select.tsx b/src/components/forms/controls/Select/Select.tsx index aefa240..ea58c51 100644 --- a/src/components/forms/controls/Select/Select.tsx +++ b/src/components/forms/controls/Select/Select.tsx @@ -89,7 +89,7 @@ export const Select = Object.assign( (props: SelectProps) => { const { children, unstyled = false, searchable, ...propsRest } = props; - const selectedRef = React.useRef>(null); + const selectedRef = React.useRef>(null); const [selected, setSelected] = React.useState(null); const listRef = React.useRef([]); diff --git a/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx b/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx index d1dddbf..4f01a3a 100644 --- a/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx +++ b/src/components/overlays/DropdownMenu/DropdownMenuProvider.tsx @@ -85,11 +85,11 @@ export const DropdownMenuProvider = Object.assign( selectedRef.current?.focus(); // Return focus }, close: () => { setIsOpen(false); }, - }), [selected, selectedRef]); + }), [selected, setIsOpen, getItemProps]); const renderAnchor = () => { const anchorProps: AnchorRenderArgs['props'] = (userProps?: undefined | React.HTMLProps) => { - const userPropsRef: undefined | string | React.Ref = userProps?.ref ?? undefined; + const userPropsRef: undefined | string | React.Ref = userProps?.ref ?? undefined; if (typeof userPropsRef === 'string') { // We can't merge refs if one of the refs is a string console.error(`Failed to render DropdownMenuProvider, due to use of legacy string ref`); @@ -112,7 +112,7 @@ export const DropdownMenuProvider = Object.assign( return {children}; } if (React.Children.count(children) === 1) { - return React.cloneElement(children, anchorProps(children.props)); + return React.cloneElement(children, anchorProps(children.props as React.HTMLProps)); } console.error(`Invalid children passed to DropdownMenuProvider, expected a render prop or single child element.`); @@ -132,7 +132,7 @@ export const DropdownMenuProvider = Object.assign( className: cx(propsRest.className), })} tabIndex={undefined} - ref={mergeRefs(refs.setFloating as any, propsRest.ref)} + ref={mergeRefs(refs.setFloating, propsRest.ref)} data-placement={placementEffective} > {items} diff --git a/src/components/overlays/Tooltip/Tooltip.stories.tsx b/src/components/overlays/Tooltip/Tooltip.stories.tsx index 8c679bc..b9ca6be 100644 --- a/src/components/overlays/Tooltip/Tooltip.stories.tsx +++ b/src/components/overlays/Tooltip/Tooltip.stories.tsx @@ -47,7 +47,7 @@ export const TooltipScroll: StoryObj = { render: () => (

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eget sem ut neque lobortis pharetra nec vel quam. Etiam sem neque, gravida sed pharetra ut, vehicula quis lectus. Donec ac rhoncus purus. Proin ultricies augue vitae purus feugiat, in ultrices lorem aliquet. Donec eleifend ac dolor a auctor. + Lorem ipsum dolor sit amet, { event.preventDefault(); }}>consectetur adipiscing elit. Pellentesque eget sem ut neque lobortis pharetra nec vel quam. Etiam sem neque, gravida sed pharetra ut, vehicula quis lectus. Donec ac rhoncus purus. Proin ultricies augue vitae purus feugiat, in ultrices lorem aliquet. Donec eleifend ac dolor a auctor.

Cras ac suscipit nibh. Fusce tincidunt iaculis dapibus. Vivamus sit amet neque eu velit tincidunt semper. Donec at magna aliquam mi consectetur imperdiet. Donec pretium placerat quam, in sodales purus porta vitae. Phasellus nisl justo, luctus vel mi vel, sollicitudin. @@ -67,7 +67,7 @@ const TooltipNativeAnchoringControlled = () => { // https://www.w3.org/TR/css-anchor-position-1/#implicit const id = React.useId(); const anchorName = `--bk-tooltip-anchor-${CSS.escape(id)}`; - const refTooltip = React.useRef>(null); + const refTooltip = React.useRef>(null); return ( <> @@ -76,7 +76,7 @@ const TooltipNativeAnchoringControlled = () => { {/* @ts-ignore Anchor Positioning not yet supported. */} This is a tooltip with a lot of text that gives more information about the element. - It has a link you can focus. + It has a { event.preventDefault(); }}>link you can focus.