question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I use the code this.scrollbar.disabled = true; and after used it this.scrollbar.disabled = false; but the function handleScroll doesn’t been used <perfect-scrollbar #scrollbar (psScrollY)="handleScroll()">

Excuse me for my poor English! Thanks

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
trocketscommented, Nov 11, 2020

@sconix I spent all morning looking at docs, googling, playing with APIs and it was a pain to find a working solution.

@yingchy1996 In my app I have a signature component that needs to have scrollY and scrollX disabled when a patient touches to sign if the user is on iPad/phone. To accomplish this I created event handlers for touch up/down on my signature pad and removed the scrollbar handlers while my signature pad was being used. I am using perfect-scrollbar as a component. Here is an example:

` class myComponent {

@ViewChild(‘scrollbar’, { static: true }) scrollbar: PerfectScrollbarComponent; public config: PerfectScrollbarConfigInterface = {}; private psHandlers: string[];

constructor(){ this.config.handlers = this.scrollbar.directiveRef.ps().settings.handlers; this.signaturePad = new SignaturePad(this.canvas.nativeElement, { onEnd: () => { this.config.handlers = this.psHandlers; }, onBegin: () => { this.config.handlers = []; this.showPrevious = false; }, }); }

}

and the .html:

<perfect-scrollbar #scrollbar class=“scrollable-form” [config]=“config”></perfect-scrollbar>`

0reactions
yingchy1996commented, Jul 19, 2019

thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable scrolling temporarily? - javascript
The scroll event cannot be canceled. But you can do it by canceling these interaction events: Mouse & Touch scroll and Buttons associated...
Read more >
How to disable scrolling temporarily using JavaScript
Whenever scrolling has to be disabled, this class is added to the body using the document.body.classList.add(“classname”) method. This method ...
Read more >
How to disable scrolling on a webpage with JavaScript
In this method we use CSS to disable the scrolling on web pages. In CSS class we set the height to 100% and...
Read more >
3 Ways To Disable Scrolling In Javascript - Code Boxx
3 Ways To Disable Scrolling In Javascript · Force scroll the user back to a specific spot or element – window. · Hide...
Read more >
Prevent Scroll On Scrollable Elements [JS & CSS] - Alvaro Trigo
There's another way to disable scrolling that is commonly used when opening modals or scrollable floating elements. And it is simply by adding ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found