Skip to content

Conversation

danielbarion
Copy link
Member

@danielbarion danielbarion commented Feb 3, 2023

close #929

@@ -38,7 +38,7 @@ const Tooltip = ({
setIsOpen,
}: ITooltip) => {
const tooltipRef = useRef<HTMLElement>(null)
const tooltipArrowRef = useRef<HTMLDivElement>(null)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to match other possible elements

@@ -19,7 +19,7 @@ const Tooltip = ({
events = ['hover'],
positionStrategy = 'absolute',
middlewares,
wrapper: WrapperElement = 'div',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value removed because there's no way to use Tooltip component directly without Controller and Controller always passes a wrapper to Tooltip

@@ -43,7 +43,7 @@ export interface ITooltip {
id?: string
variant?: VariantType
anchorId?: string
wrapper?: WrapperType
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible undefined removed because there's no way to use Tooltip component directly without Controller and Controller always passes a wrapper to Tooltip

@@ -85,7 +85,7 @@ const TooltipController = ({
setTooltipOffset(value === null ? offset : Number(value))
},
wrapper: (value) => {
setTooltipWrapper((value as WrapperType) ?? 'div')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix.

when the component start to check anchor attributes and there's no wrapper, the wrapper state gets updated to be a div

@danielbarion danielbarion merged commit 8af7a46 into master Feb 3, 2023
@danielbarion danielbarion deleted the fix/wrapper-behavior branch February 3, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT REQ] Customizable Arrow Wrapper
2 participants