Skip to content

Commit 66b95c6

Browse files
committed
fix(flexible): 更新getScrollbarWidth函数,添加样式以隐藏滚动条元素并禁用指针事件
1 parent 4d80e8d commit 66b95c6

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

packages/flexible/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cherrywind/flexible",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"private": false,
55
"keywords": [
66
"flexible"

packages/flexible/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ function getScrollbarWidth(classname?: string): number {
312312
scrollDiv.style.position = 'absolute';
313313
scrollDiv.style.top = '-9999px';
314314
scrollDiv.style.display = 'block';
315+
scrollDiv.style.visibility = 'hidden';
316+
scrollDiv.style.pointerEvents = 'none';
317+
315318
if (classname) {
316319
scrollDiv.classList.add(classname);
317320
}

0 commit comments

Comments
 (0)