Skip to content

Commit

Permalink
1.3.1 Automatically open diversities menu after long hover
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Aug 24, 2017
1 parent d7ed06a commit a9a75f8
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<body>
<div id="root"></div>
<div id="error-display"></div>
<script src="static/preview.52b5a34a5a8fcb43e9b0.bundle.js"></script>
<script src="static/preview.b44139a9cb97c9cc5aed.bundle.js"></script>
</body>
</html>

1 change: 0 additions & 1 deletion docs/static/preview.52b5a34a5a8fcb43e9b0.bundle.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/preview.b44139a9cb97c9cc5aed.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "emoji-picker-react",
"version": "1.3.0",
"version": "1.3.1",
"description": "React emoji-picker component",
"main": "./dist/index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/Emoji/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@ class Emoji extends Component {
if (this.props.emojiProps.parent._emojiName) {
this.props.emojiProps.parent._emojiName.textContent = this.emoji.name;
}

this.onMouseEnterTimeout = setTimeout(() => {
this.props.emojiProps.openDiversitiesMenu(this.props.member);
}, OPEN_DIVERSITIES_TIMEOUT);
}

onMouseLeave(e) {

clearTimeout(this.onMouseEnterTimeout);

if (e.relatedTarget && e.relatedTarget.classList && e.relatedTarget.classList.contains('emoji')) {
return;
}
Expand All @@ -56,6 +62,8 @@ class Emoji extends Component {

onMouseDown() {

clearTimeout(this.onMouseEnterTimeout);

if (!this.hasDiversities) {
return;
}
Expand Down

0 comments on commit a9a75f8

Please sign in to comment.