This repository has been archived by the owner on Nov 9, 2024. It is now read-only.
OnShow not working and some props not working properly as well ? #1102
Unanswered
destructo570
asked this question in
Q&A
Replies: 1 comment
-
Okay So what I am doing now is getting a prop show_tooltip and based on that I return the tippy wrapped component or just return the child/trigger component that my component wraps. return show_tooltip ? ( This solves the problem of conditionally rendering the tooltip. But I still don't know why the duration prop is not working |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello I am creating a wrapper around tippy and some props are not working properly I don't know if I am doing something wrong.
This is my code (I hid the props value to avoid bloat)
` import Tippy from "@tippyjs/react/headless";
import PropTypes from "prop-types";
export const Tooltip = ({
content,
delay,
duration,
position,
children,
calc_offset,
offset_x,
offset_y,
align_offset,
wrap_child,
tooltip_classes,
tooltip_arrow_classes,
...props
}) => {
const onShowHandler = () => false;
return (
<Tippy
placement={position}
content={"Hello world"}
delay={delay}
onShow={onShowHandler}
duration={duration}
offset={calc_offset ? calculateOffset : [offset_x, offset_y]}
hideOnClick={false}
trigger={"focus mouseenter"}
render={render_tooltip}
{...props}
>
{wrap_child && children ? {children} : children ? children : null}
);
};`
So I am passing a onShow function and returning false from it but on hover it is still showing up.
And same with duration prop when i set the duration prop I don't get any animation the tooltip shows up with the animation and then after the end duration it just hides without any animation.
Beta Was this translation helpful? Give feedback.
All reactions