Code Monkey home page Code Monkey logo

Comments (4)

rdkmaster avatar rdkmaster commented on June 5, 2024 1

I've look into the source code of malihu scrollbar, I found that the scrollbar's implementation is using setTimeout to perform a loop check and thus to perform scrolling, it update in 50ms in default. That is to say, the implementation will invoke setTimeout time and time again as soon as it initialized.

As we have already known, everytime after setTimeout, zone of Angular will run the change detection, and the DoCheck life cycle will be invoked, and this is the reason that causes this issue. I check latest commit of malihu scrollbar, it is more that one year ago, and I think the author is not likely to fix this issue, I also sadly think this issue is NOT fixable, because it is the base of the implementation.

I've decided to give up this scrollbar implementation.

Btw, you can take a look at my repo, we've made 30 components based on Angular including a scrollbar directive, and the number is increasing, you can find it here https://github.com/rdkmaster/jigsaw, join us if you like it.

from ngx-malihu-scrollbar.

jfcere avatar jfcere commented on June 5, 2024

Hi @rdkmaster,

Thanks for pointing it out, following your steps I've been able to improve the performance.

Please update to v1.2.1 and give me some feedback.

image

from ngx-malihu-scrollbar.

rdkmaster avatar rdkmaster commented on June 5, 2024

@jfcere you need to leave at least one scrollbar in the view, this is the key to this issue, remove
all scrollbars in the view and angular will not initialize malihu-scrollbar anymore, and the setTimeout will not be invoked.

from ngx-malihu-scrollbar.

jfcere avatar jfcere commented on June 5, 2024

I did pretty much the best I could do on my side by improving the change detection for this Angular wrap but of course it won't fix the existing behavior or the original Malihu Scrollbar plugin.

from ngx-malihu-scrollbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.