prscX / react-native-tooltips

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

Need a callback function onHide ToolTip #1

Closed congnguyen91 closed 6 years ago

congnguyen91 commented 6 years ago

Thank for your module! It would be better if it has a callback when tooltip hided :)

prscX commented 6 years ago

Hi @congnguyen91,

I have added onHide callback support for both Android & iOS. On iOS their are few issue's for which I have raised the PR: 6 to native library, once it is approved onHide callback will start working on iOS as well.

Please download the latest V0.0.3 in order to use this functionality.

Thanks Pranav

prscX commented 6 years ago

Hi @congnguyen91, I have pointed iOS native library onHide fix to my fork. Once it is merged I will point the same to original release version tag.

Now you will be able to get onHide callback on both Android and iOS. Let me know in case you face any issues.

Thanks Pranav

bradyhigginbotham commented 6 years ago

Is the onHide fix available in v0.0.4 for iOS? onHide does not seem to be firing in the simulator when the tooltip is closed. This is when using either autoHide or clickToHide. The tip closes; the callback just isn't fired.

<View ref={this.updateRef}>
  <Button title="Open Tooltip" onPress={this.onPress} />
  <Tooltip
    text="sample tip message"
    textSize={14}
    clickToHide
    onHide={() => console.log('hidden')} <== not firing
    visible={this.state.visible}
    reference={this.state.reference}
  />
</View>
prscX commented 6 years ago

Thanks @bradyhigginbotham for raising the concern. I have tested onHide on latest version 0.0.6 and it is working as expected.

Can you please install the same and verify, please let me know in case you still face the same issue.

Thanks </ Pranav >