Skip to content

Commit

Permalink
1.2.11 Improved fake scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
ealush committed Aug 15, 2017
1 parent 3d5d3a3 commit f94e452
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 82 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.56b6191e94ff97cdc1bf.bundle.js"></script>
<script src="static/preview.77d1a63fd6652ab7d7ab.bundle.js"></script>
</body>
</html>

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</head>
<body style="margin: 0;">
<div id="root"></div>
<script src="static/manager.d6a42eb6d12b67ebe0b2.bundle.js"></script>
<script src="static/manager.1bab24b126040818739b.bundle.js"></script>
</body>
</html>

34 changes: 34 additions & 0 deletions docs/static/manager.1bab24b126040818739b.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/manager.1bab24b126040818739b.bundle.js.map

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

34 changes: 0 additions & 34 deletions docs/static/manager.d6a42eb6d12b67ebe0b2.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/manager.d6a42eb6d12b67ebe0b2.bundle.js.map

This file was deleted.

40 changes: 0 additions & 40 deletions docs/static/preview.56b6191e94ff97cdc1bf.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/preview.56b6191e94ff97cdc1bf.bundle.js.map

This file was deleted.

40 changes: 40 additions & 0 deletions docs/static/preview.77d1a63fd6652ab7d7ab.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/static/preview.77d1a63fd6652ab7d7ab.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.2.10",
"version": "1.2.11",
"description": "React emoji-picker component",
"main": "./dist/index.js",
"scripts": {
Expand Down
5 changes: 3 additions & 2 deletions src/EmojiPicker/helpers/adjust_scrollbar/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default function adjustScrollbar(scrollHeight, scrollTop, listHeight, _scroller) {
const wholeRange = (scrollHeight),

const wholeRange = scrollHeight - listHeight,
visibleRange = (listHeight - 15),
newPos = ((scrollTop) * visibleRange) / wholeRange;
newPos = (scrollTop * visibleRange) / (wholeRange);

_scroller.setAttribute('style', `transform: translateY(${newPos}px)`);
}
2 changes: 1 addition & 1 deletion src/EmojiPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class EmojiPicker extends Component {
active = this.active,
_active = this._categories[active];

if (!isFFMac) {
if (!isFFMac && !(this.scrollHeight <= this.listHeight)) {
adjustScrollbar(this.scrollHeight, scrollTop, this.listHeight, this._scroller);
this.hideScrollIndicator();
this._scroller.classList.add('shown');
Expand Down

0 comments on commit f94e452

Please sign in to comment.