Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f1f2aba

Browse filesBrowse files
committed
Move disable interaction to a dedicated styles
1 parent 6aa10e7 commit f1f2aba
Copy full SHA for f1f2aba

File tree

Expand file treeCollapse file tree

3 files changed

+18
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+18
-11
lines changed
Open diff view settings
Collapse file
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* DisableInteraction: 'true' | 'false'
3+
* Disables scrollbar interaction like dragging thumb and jumping by track click
4+
*/
5+
@mixin SetDisableInteractionStuff() {
6+
--_viewport-pointer-events: auto;
7+
--_scrollbar-pointer-events: auto;
8+
9+
// Disables scroll when disableInteraction is set to true
10+
pointer-events: var(--_viewport-pointer-events);
11+
12+
&[disableInteraction="true"] {
13+
--_viewport-pointer-events: none;
14+
--_scrollbar-pointer-events: none;
15+
}
16+
}
Collapse file

‎projects/ngx-scrollbar/src/lib/viewport/scroll-viewport.scss‎

Copy file name to clipboardExpand all lines: projects/ngx-scrollbar/src/lib/viewport/scroll-viewport.scss
+2-10Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@use "../styles/scroll" as scroll;
88
@use "../styles/dragging" as dragging;
99
@use "../styles/overscroll-behavior" as overscrollBehavior;
10+
@use "../styles/disable-interaction" as disableInteraction;
1011

1112
:host {
1213
// CSS variables used to customized the look of the scrollbar component
@@ -28,7 +29,6 @@
2829
/** Scrollbar private CSS variables **/
2930

3031
--_scrollbar-computed-thickness: calc(var(--_scrollbar-thickness) + var(--_scrollbar-offset) * 2);
31-
--_scrollbar-pointer-events: auto;
3232

3333
// Convert margin to px value to avoid repeating calculation when used in multiple times
3434
--_scrollbar-offset-px: calc(var(--_scrollbar-offset) * 1px);
@@ -37,7 +37,6 @@
3737

3838
// The default value for overflow
3939
--_viewport-overflow: auto;
40-
--_viewport-pointer-events: auto;
4140

4241
// Content display, will switch to block if orientation is set to vertical
4342
--_scrollbar-content-width: fit-content;
@@ -64,9 +63,6 @@
6463
// Disable selection when a scrollbar is being dragged
6564
user-select: var(--_viewport-user-select);
6665

67-
// Disables scroll when disableInteraction is set to true
68-
pointer-events: var(--_viewport-pointer-events);
69-
7066
&[orientation="vertical"] {
7167
--_viewport-overflow: hidden auto;
7268
--_scrollbar-content-width: unset;
@@ -76,11 +72,6 @@
7672
--_viewport-overflow: auto hidden;
7773
}
7874

79-
&[disableInteraction="true"] {
80-
--_viewport-pointer-events: none;
81-
--_scrollbar-pointer-events: none;
82-
}
83-
8475
@include spacer.SetSpacerStyles();
8576

8677
@include nativeScrollbars.HideNativeScrollbars();
@@ -90,6 +81,7 @@
9081
@include scroll.SetScrollingStuff();
9182
@include dragging.SetDraggingStuff();
9283
@include overscrollBehavior.SetOverscrollBehaviorStuff();
84+
@include disableInteraction.SetDisableInteractionStuff();
9385
}
9486

9587
@layer default {
Collapse file

‎projects/ngx-scrollbar/src/lib/viewport/viewport-adapter.ts‎

Copy file name to clipboardExpand all lines: projects/ngx-scrollbar/src/lib/viewport/viewport-adapter.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
OutputEmitterRef,
1414
InputSignalWithTransform
1515
} from '@angular/core';
16-
import { Platform } from '@angular/cdk/platform';
1716
import { Direction, Directionality } from '@angular/cdk/bidi';
1817
import { toSignal } from '@angular/core/rxjs-interop';
1918
import {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.