Skip to content

Commit 82cbea1

Browse files
committed
1.4.0 [Feauture] Change the scrollbar size relative to the content of the picker
1 parent 5e48c91 commit 82cbea1

11 files changed

+35
-30
lines changed

docs/iframe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<body>
1717
<div id="root"></div>
1818
<div id="error-display"></div>
19-
<script src="static/preview.1153246074b22a3b7602.bundle.js"></script>
19+
<script src="static/preview.22fbecbe07f7941da267.bundle.js"></script>
2020
</body>
2121
</html>
2222

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</head>
3939
<body style="margin: 0;">
4040
<div id="root"></div>
41-
<script src="static/manager.ef6fecb46e3c429d06e2.bundle.js"></script>
41+
<script src="static/manager.56cfe3116ef4dfe0e5a9.bundle.js"></script>
4242
</body>
4343
</html>
4444

docs/static/manager.ef6fecb46e3c429d06e2.bundle.js renamed to docs/static/manager.56cfe3116ef4dfe0e5a9.bundle.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/manager.ef6fecb46e3c429d06e2.bundle.js.map renamed to docs/static/manager.56cfe3116ef4dfe0e5a9.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/preview.1153246074b22a3b7602.bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/preview.1153246074b22a3b7602.bundle.js renamed to docs/static/preview.22fbecbe07f7941da267.bundle.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/static/preview.22fbecbe07f7941da267.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emoji-picker-react",
3-
"version": "1.3.2",
3+
"version": "1.4.0",
44
"description": "React emoji-picker component",
55
"main": "./dist/index.js",
66
"scripts": {
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
import { MIN_SCROLLBAR_HEIGHT_PADDED } from '../../../constants';
2+
13
export default function adjustScrollbar(scrollHeight, scrollTop, listHeight, _scroller) {
24

5+
const scrollbarHeight = Math.floor((listHeight/(scrollHeight/listHeight)) * 0.8);
6+
37
const wholeRange = scrollHeight - listHeight,
4-
visibleRange = (listHeight - 15),
8+
visibleRange = (listHeight - (scrollbarHeight < MIN_SCROLLBAR_HEIGHT_PADDED ? MIN_SCROLLBAR_HEIGHT_PADDED : scrollbarHeight)),
59
newPos = (scrollTop * visibleRange) / (wholeRange);
610

711
_scroller.setAttribute('style', `transform: translateY(${newPos}px)`);
12+
_scroller.children[0].setAttribute('style', `height: ${scrollbarHeight}px`);
813
}

src/EmojiPicker/picker.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
position: absolute;
7070
width: 5px;
7171
padding-top: 5px;
72-
height: 20px;
7372
z-index: 2;
7473
right: 3px;
7574
box-sizing: border-box;
@@ -83,7 +82,7 @@
8382
div {
8483
background-color: $md-grey-400;
8584
width: 100%;
86-
height: 10px;
85+
min-height: 10px;
8786
}
8887
}
8988

0 commit comments

Comments
 (0)