Comments (11)
I'm on vacation till 28th Dec. I will update this on 29th. Happy to accept a PR.
from react-native-tooltip.
This fork has done it already:
https://github.com/taskrabbit/react-native-tooltip
On Wed, Dec 23, 2015 at 6:19 AM Chirag [email protected] wrote:
I'm on vacation till 28th Dec. I will update this on 29th. Happy to accept
a PR.—
Reply to this email directly or view it on GitHub
#5 (comment)
.
from react-native-tooltip.
@jrichardlai seems like you made some interesting changes in your fork. Seems like you tweaked the JS api as well. can you describe the changes here and eventually merge the two codebases if it works out?
from react-native-tooltip.
@chirag04 I have done some update to the api yes. Thank you for this library it is really useful.
The use case I was trying to do was mosty having a long press on a view and being able to copy it.
I wanted it to be able to create a tooltip on any element, you can put the tooltip around View
and Image
.
I also wanted to make only one component to use. And it seemed easier in our case to just pass down directly the callback instead of checking the value of the text clicked.
For example you could do this:
class Message extends React.Component {
handleCopyPress = () => {
Clipboard.set('Something something');
}
handleSendSMSPress = () => {
alert('Sending SMS');
}
render() {
return (
<ToolTip
actions={[
{text: 'Copy', onPress: this.handleCopyPress},
{text: 'Send By SMS', onPress: this.handleSendSMSPress},
]}
underlayColor={cssVar('trGreen10')}
longPress={true}
>
<Text>Something something</Text>
</ToolTip>
);
}
}
I removed the ToolTipText
component, since it was redundant with the Tooltip
but I can keep it and make a PR if you'd like.
from react-native-tooltip.
@jrichardlai For some reason you fork doesn't work for me in RN 0.17
I am hit with: Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object
This is my code:
<ToolTip
actions={[
{text: 'x', onPress: () => console.log("X") }
{text: 'y', onPress: () => console.log("Y") }
]}
underlayColor={'blue'}
style={textElements.selectedName}
>
<Text>
{user.name}
</Text>
</ToolTip>
it seems that in your ToolTop.ios.js file you need to write in the end: module.exports = ToolTipText
Sorry for posting this here but I couldn't find the 'issues' tab in your fork
from react-native-tooltip.
@eyaleizenberg thanks let me fix this :)
from react-native-tooltip.
@eyaleizenberg seems to work fine for me, I added an Example App you can take a look
from react-native-tooltip.
@eyaleizenberg @chirag04 any news?
from react-native-tooltip.
@jrichardlai, @chirag04, I think the changes jrichardlai made are great additions to the component. I would suggest merging the changes back into the main project, although I would keep things ES5 compatible like it is today. Any objections?
from react-native-tooltip.
No objections. @jrichardlai @sevachb Can one of you PR?
from react-native-tooltip.
we merged the two codebases. It should be fixed on master now.
from react-native-tooltip.
Related Issues (20)
- callback for dismissing HOT 1
- Android support HOT 6
- Does not work when used over WebView. HOT 5
- can't run HOT 3
- Selected Text
- Undefined is Not an Object('evaluating ToolTipMenu.Show') HOT 5
- onLayout prop is missing x,y in callback's e.nativeEvent.layout
- Copy item added when tooltip is inside of a Text component HOT 1
- Please specify compatible version for Reac-native version
- Replace React.createClass with createReactClass (react 15.5+) HOT 3
- React.PropTypes is removed in RN 0.49 HOT 1
- Collaborators
- Tooltip style change. HOT 1
- Error: Invariant Violation, Native component does not exist HOT 4
- Please support Android HOT 2
- Can I order the position of each item inside the menu?
- with big tetxt
- Tooltip disappearing after first tap HOT 2
- Links in the installation aren't working
- TypeError: undefined is not an object (evaluating 'Object.keys(_reactNative.TouchableHighlight.propTypes)')
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-tooltip.