-
-
Notifications
You must be signed in to change notification settings - Fork 538
fix: wrapper element changing after first render #935
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
Conversation
setIsOpen, | ||
}: ITooltip) => { | ||
const tooltipRef = useRef<HTMLElement>(null) | ||
const tooltipArrowRef = useRef<HTMLDivElement>(null) |
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.
updated to match other possible elements
events = ['hover'], | ||
positionStrategy = 'absolute', | ||
middlewares, | ||
wrapper: WrapperElement = 'div', |
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.
default value removed because there's no way to use Tooltip component directly without Controller and Controller always passes a wrapper
to Tooltip
id?: string | ||
variant?: VariantType | ||
anchorId?: string | ||
wrapper?: WrapperType |
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.
possible undefined
removed because there's no way to use Tooltip component directly without Controller and Controller always passes a wrapper
to Tooltip
setTooltipOffset(value === null ? offset : Number(value)) | ||
}, | ||
wrapper: (value) => { | ||
setTooltipWrapper((value as WrapperType) ?? 'div') |
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.
the fix.
when the component start to check anchor attributes and there's no wrapper
, the wrapper
state gets updated to be a div
close #929