prscX / react-native-tooltips

React Native: Native Tooltip View
Apache License 2.0
271 stars 40 forks source link

Can't dismiss tooltip using visible = false #9

Closed StevenMasini closed 5 years ago

StevenMasini commented 5 years ago

Hi Pranav,

I found out that you can't use the props visible to dismiss the tooltips. Actually you forgot to mention the dismiss props in your documentation. That's the one that should be used to dismiss the tooltips.

But also while dismiss must be equal to true, the visible props must also be equal to true.

componentDidUpdate() {
    if (this.props.visible && this.props.reference) {
      if (this.props.dismiss) {
        Tooltips.Dismiss(findNodeHandle(this.props.reference));
      } else {
        Tooltips.Show(findNodeHandle(this.props.reference), {
          text: this.props.text,
          position: this.props.position,
          align: this.props.align,
...

I think we should mention in the documentation, explain how to dismiss the tooltip.

prscX commented 5 years ago

Thanks @StevenMasini for raising the issue.

I have fixed and pushed a release with the same. Can you please install/download latest version of library.

Please let me know incase you still face the same issue.

Thanks </ Pranav >

StevenMasini commented 5 years ago

I saw the fix, thanks 👍