@knotx/plugins-canvas-scrollbar 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -199,6 +199,9 @@ class CanvasScrollbar extends (_a = core.BasePlugin, _showScrollbars_dec = [deco
|
|
|
199
199
|
const maxScroll = contentHeight - this.container.height;
|
|
200
200
|
const clickPercentage = (clickPosition - thumbHalfHeight) / (trackHeight - thumbRect.height);
|
|
201
201
|
const newScrollY = Math.max(0, Math.min(maxScroll, clickPercentage * maxScroll));
|
|
202
|
+
if (Number.isNaN(newScrollY)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
202
205
|
this.callTool("canvas", "setTransform", {
|
|
203
206
|
positionX: this.transform.positionX,
|
|
204
207
|
positionY: -newScrollY,
|
package/dist/index.js
CHANGED
|
@@ -197,6 +197,9 @@ class CanvasScrollbar extends (_a = BasePlugin, _showScrollbars_dec = [observabl
|
|
|
197
197
|
const maxScroll = contentHeight - this.container.height;
|
|
198
198
|
const clickPercentage = (clickPosition - thumbHalfHeight) / (trackHeight - thumbRect.height);
|
|
199
199
|
const newScrollY = Math.max(0, Math.min(maxScroll, clickPercentage * maxScroll));
|
|
200
|
+
if (Number.isNaN(newScrollY)) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
200
203
|
this.callTool("canvas", "setTransform", {
|
|
201
204
|
positionX: this.transform.positionX,
|
|
202
205
|
positionY: -newScrollY,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knotx/plugins-canvas-scrollbar",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Canvas Scrollbar Plugin for Knotx",
|
|
5
5
|
"author": "boenfu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"react": ">=17.0.0",
|
|
32
|
-
"@knotx/jsx": "0.5.
|
|
33
|
-
"@knotx/plugins-canvas": "0.5.
|
|
32
|
+
"@knotx/jsx": "0.5.7",
|
|
33
|
+
"@knotx/plugins-canvas": "0.5.7"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@knotx/core": "0.5.
|
|
37
|
-
"@knotx/decorators": "0.5.
|
|
36
|
+
"@knotx/core": "0.5.7",
|
|
37
|
+
"@knotx/decorators": "0.5.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "^17.0.0",
|
|
41
41
|
"react": "^17.0.0",
|
|
42
|
-
"@knotx/build-config": "0.5.
|
|
43
|
-
"@knotx/eslint-config": "0.5.
|
|
44
|
-
"@knotx/jsx": "0.5.
|
|
45
|
-
"@knotx/plugins-canvas": "0.5.
|
|
46
|
-
"@knotx/typescript-config": "0.5.
|
|
42
|
+
"@knotx/build-config": "0.5.7",
|
|
43
|
+
"@knotx/eslint-config": "0.5.7",
|
|
44
|
+
"@knotx/jsx": "0.5.7",
|
|
45
|
+
"@knotx/plugins-canvas": "0.5.7",
|
|
46
|
+
"@knotx/typescript-config": "0.5.7"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "unbuild",
|