Skip to content

Commit 653fc69

Browse files
committed
0.5.0
1 parent d0f1d78 commit 653fc69

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-hover",
3-
"version": "0.4.2",
4-
"description": "show anything when mouse hover",
3+
"version": "0.5.0",
4+
"description": "A handy hover tool for React",
55
"main": "dist/index.js",
66
"scripts": {
77
"prepublish": "parallelshell -w \"npm run build:dist -s\" \"npm run build:example -s\" \"npm run build:bower -s\"",

src/lib/TriggerComponent.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export default class TriggerComponent extends Component {
2121
onMouseOver={this.onMouseOver.bind(this)}
2222
onMouseOut={this.onMouseOut.bind(this)}
2323
onMouseMove={this.onMouseMove.bind(this)}
24+
onTouchStart={this.onTouchStart.bind(this)}
25+
onTouchEnd={this.onTouchEnd.bind(this)}
2426
dangerouslySetInnerHTML={{ __html: componentHtml.trigger }}
2527
>
2628
</h1>
@@ -42,4 +44,13 @@ export default class TriggerComponent extends Component {
4244
getCursorPos(e);
4345
}
4446

47+
onTouchStart() {
48+
const { setVisibility } = this.props;
49+
setVisibility(true);
50+
}
51+
52+
onTouchEnd() {
53+
const { setVisibility } = this.props;
54+
setVisibility(false);
55+
}
4556
}

0 commit comments

Comments
 (0)