GithubHelp home page GithubHelp logo

react-native-tooltip's People

Contributors

chirag04 avatar doronpr avatar eliperkins avatar enahum avatar imartingraham avatar jedt avatar johakr avatar jrichardlai avatar sevachb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-tooltip's Issues

can't run

1、Duplicate interface definition for class 'RCTView'
2、Property has a previous declaration

"react": "15.4.1",
"react-native": "0.40.0",

onLayout prop is missing x,y in callback's e.nativeEvent.layout

I'm dropping in Tooltip as a replacement for my existing components, iterated as rows inside a listview over a data array. For example, a row:

<ToolTip onLayout={(e) => console.log(index, `Summary ${rowID} onLayout:`, e.nativeEvent.layout)}>
  <Text ...>
</ToolTip>

console logs would return for each row, e.nativeEvent.layout.width and .height as expected. .x and .y however always return 0, while TouchableHighlight returns the x,y coordinates of the rendered component as documented (React Native).

Is this a bug that e.nativeEvent.layout is not fully inherited from TouchableHighlight, or rather, the parent touchablewithoutfeedback?

Please specify compatible version for Reac-native version

in my react-native version 0.39 this library not works.

I had to do magic to find the correct version and with a lot of luck, I found that the compatible version of this library that is version of react was 4.1.0.

It would be of great help with table with these specifications, thanks

callback for dismissing

Hi, author and contributors. Do you think it's possible that tooltip provides a callback invoked when it got dismissed? it's quite important when I try to combine it with redux and make it driven by state.

Does not work when used over WebView.

I am working on a project where I need to show UIMenuController with custom option when user selects some html content in a WebView, when I place the webView inside ToolTip, it should work but It doesn't, Instead It won't even let WebView to Render.

Points to be noted:

  • I am Using alinz/react-native-webview-bridge Library for WebView and It pretty much works.
  • I want to add a custom option in the UIMenuController that performs some operation on the WebView contents.

Tooltip style change.

Hey,

I am trying to change tooltip styling but seems like there is no option to change. Is there any way to modify styling of tooltip ?

Thanks,

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.
output

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

output

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!

Event for closing

Is there an event for blur? (when not selecting anything from the tooltip?)

Thanks.

Android support

This is a great plugin but having it work only on IOS makes it not as useful. Any plans on making this work on Android as well?

Thanks!

Field steals focus

Tapping on the element, steals the focus and dismisses the keyboard. Is there a way I can prevent this from happening? keyboardShouldPersistTaps={true} didn't work...

Replace React.createClass with createReactClass (react 15.5+)

Chrome console output, on RN 0.46.2:

ExceptionsManager.js:71 Warning: React.createClass is no longer supported. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement. (https://fb.me/migrating-from-react-create-class)
reactConsoleErrorHandler | @ | ExceptionsManager.js:71
-- | -- | --
  | printWarning | @ | warning.js:36
  | warning | @ | warning.js:60
  | get | @ | react.development.js:2125
  | (anonymous) | @ | ToolTip.ios.js:24
  | loadModuleImplementation | @ | require.js:174
  | guardedLoadModule | @ | require.js:126
  | _require | @ | require.js:110
  | (anonymous) | @ | components.js:53
  | loadModuleImplementation | @ | require.js:174
  | guardedLoadModule | @ | require.js:126
  | _require | @ | require.js:110
  | (anonymous) | @ | index.ios.js:86
  | loadModuleImplementation | @ | require.js:174
  | guardedLoadModule | @ | require.js:119
  | _require | @ | require.js:110
  | (anonymous) | @ | redux-logger.js:1
  | executeApplicationScript | @ | debuggerWorker.js:40
  | (anonymous) | @ | debuggerWorker.js:65

A sample PR to fix: https://github.com/maxs15/react-native-modalbox/pull/148/files

How can I style it like `TouchableWithoutFeedback`

I trigger the tooltip programmatically when user touches container. But the container will be "highlighted", even if I tried to set some properties like underlayColor='transparent'.
I wonder how can I remove the highlight effect.

Undefined is Not an Object('evaluating ToolTipMenu.Show')

I have using this module getting this Like as below screen shot.
simulator screen shot jan 27 2017 12 06 21 pm

Undefined is Not an Object('evaluating ToolTipMenu.Show')

I have use this Code

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  Alert,
  AlertIos,
  Image,
  PixelRatio,
  Coordinates,
  TouchableOpacity,
  NativeModules,
  View
} from 'react-native';
var Dimensions = require('Dimensions');
var windowSize = Dimensions.get('window');
var ToolTip = require('react-native-tooltip');
var ToolTipMenu = NativeModules.ToolTipMenu;

export default class index extends Component {
  constructor(props) {
    super(props)
    this.state={
      xcor:null,
      ycor:null,
      corx:'',
      array:[],
      count: 0

    }
  }


handlePress(evt){
  var array =this.state.array
  var count = 0
  console.log("Coordinates",`x coord = ${evt.nativeEvent.locationX}`);
  console.log("Coordinates",`y coord = ${evt.nativeEvent.locationY}`);
  var cordinates = {
    "xcor":evt.nativeEvent.locationX,
    "ycor":evt.nativeEvent.locationY}
  array.push(cordinates)
  this.setState({
    array:array
  })

 /* this.setState({
    xcor:evt.nativeEvent.locationX,
    ycor:evt.nativeEvent.locationY,
    corx:evt.nativeEvent.locationX
  })*/
}

  render() {
    var array =[];
    if(this.state.array.length != 0){
      this.state.array.map((res)=>{
        array.push(
          <View style={styles.textinputContainer}>
          <ToolTip
            ref='theToolTip'
            actions={[
              {text: 'xcor', onPress: () => { this.setState({input: 'x pressed'}) }},
              {text: 'ycor', onPress: () => { this.setState({input: 'y pressed'}) }}
            ]}
            underlayColor='transparent'
            longPress={false}
            arrowDirection='down'
            style={styles.textinput}
          >
           <View style={{position:"relative",flex:1,left:res.xcor,top:res.ycor}}>
            <Image source={require('./logo.png')} style={{resizeMode:'cover',width:50,height:50}}>
            </Image>
          </View>
          </ToolTip>
        </View>
          
          )
      })
    }
    return (
      <View style={styles.container}>
      <View style={{position:'absolute'}}>
      <TouchableOpacity onPress={(evt) => this.handlePress(evt)}>
      <Image source={require('./back1.jpg')} style={{resizeMode:'cover',width:windowSize.width,height:windowSize.height}}>
        </Image>
         </TouchableOpacity>
      
        </View>
       
        {this.state.array.length != 0 ?(
          <View>
          {array}
      </View>
          ):(<View></View>)
         }
         
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
   
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
  textinputContainer: {
    marginTop: 20,
    justifyContent: 'center',
    alignItems: 'center',
  },
  textinput: {
    width: 60,
    //marginVertical: 2,
    //marginHorizontal: 2,
    borderWidth: 1 / PixelRatio.get(),
    borderRadius: 5,
    borderColor: '#c7c7cc',
    padding: 2,
    fontSize: 14,
    backgroundColor: 'white',
  }
});

module.exports=index;

Fails to build on 0.8.0

Receiving this error when trying to build:

/[...]/node_modules/react-native-tooltip/ToolTipMenu/RCTToolTipText.m:27:23: No visible @interface for 'RCTEventDispatcher' declares the selector 'sendTextEventWithType:reactTag:text:eventCount:'

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.