Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable/ Suppress the scroll bar during runtime #658

Closed
starsibi opened this issue Sep 17, 2024 · 1 comment · Fixed by #670
Closed

Disable/ Suppress the scroll bar during runtime #658

starsibi opened this issue Sep 17, 2024 · 1 comment · Fixed by #670
Labels

Comments

@starsibi
Copy link

Feature Description

Disabling or suppressing the scrollbar during runtime in an Angular application involves dynamically controlling the scrollbar’s interaction based on certain conditions or user actions. This feature is useful when you want to temporarily prevent users from scrolling through content, perhaps during a loading state or when displaying a modal dialog.

Key Points:
Dynamic Control: You can enable or disable the scrollbar interaction at any point during the application’s runtime.
User Interaction: The feature typically involves toggling a boolean property that controls whether the scrollbar is active or suppressed.
Implementation: This is achieved using the disableInteraction property of the ngx-scrollbar component, which can be bound to a variable in your component’s class.
Use Cases: Common scenarios include preventing scrolling while data is being fetched, during animations, or when a modal or overlay is active.

@MurhafSousli
Copy link
Owner

MurhafSousli commented Sep 20, 2024

There is disableInteraction option with the scrollbar controls, but it doesn't disable scrolling with controls outside the scrollbar such as the wheel, touchpad, touch gestures, because it is a native functionality. you can simply disable the scroll by toggling a class that sets overflow: hidden on the viewport

@MurhafSousli MurhafSousli linked a pull request Nov 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants