react-native-tooltip
react-native-tooltip copied to clipboard
Tooltip disappearing after first tap
Hey there! First of all, thanks for this cool library. It has been working great.
We are having an issue when displaying the tooltip the first time after the user opens the app.

The tooltip dissapears that first time. After that, it works correctly:

The code is simple:
export default class ContextMenu extends React.PureComponent {
componentWillUnmount() {
if (this.ref) {
this.ref.hideMenu();
delete this.ref;
}
}
setRef = (ref) => {
if (!ref) {
return;
}
this.ref = ref;
if (ref) {
setTimeout(() => {
if (this.ref) {
this.ref.showMenu();
}
}, 100);
}
}
render() {
const actions = getActions(this.props);
return (
<ToolTip
actions={actions}
ref={this.setRef}
>
<View />
</ToolTip>
);
}
}
Note that we had to introduce that delay because the tooltip doesn't appear when placed in componentDidMount.
I tried to debug this, as I thought that a hideMenu() was being called, but it wasn't. showMenu() is called correctly and then the context menu disappears without a call to hideMenu().
Any help would be appreciated, thanks!
@FranDepascuali did you find a way to solve this? it's happening with me too :/
@andrewdazs no longer working with RN, sorry!