Coder Social home page Coder Social logo

Comments (5)

sconix avatar sconix commented on August 16, 2024 1

Good points. I can add directive for this library later this week. Although I think the component is more clear for using in templates, but I am sure that there are many other who think the directive is the way to go.

from ngx-perfect-scrollbar.

sconix avatar sconix commented on August 16, 2024

Why would this be needed? It should be block as a default and I would not like to add style that might cause problems when using flex box for example.

from ngx-perfect-scrollbar.

craigmichaelmartin avatar craigmichaelmartin commented on August 16, 2024

Thanks for your response. I am not seeing it to be block by default. I must add it. And the flexbox example in the repo works the same with the addition. For the minority of cases where some some other display type is desired - they may specify otherwise. It seems tedious to make the majority do so.

In any event, a perfect-scrollbar component wrapper will not work for my use cases - where I want perfect-scrollbar applied to various components. I made a really simple directive wrapper instead.

from ngx-perfect-scrollbar.

sconix avatar sconix commented on August 16, 2024

Ok if there is no harm from it I can add it, I just assumed that it should be the default display type. I will make a new release soon.

Do you mean that you made a directive for perfect scrollbar? If yes then how is it more convenient / better as a directive?

from ngx-perfect-scrollbar.

craigmichaelmartin avatar craigmichaelmartin commented on August 16, 2024

Great, I think your users / future users will find it less tedious (or even working at all). I almost gave up trying this lib because I couldn't get it without using flex (which I didn't want to do). I finally saw that the host element was defaulting (as angular2 does for components, I think) to display: inline. Fixing that made it work.

Yeah, I made a super light directive which wraps the perfect-scrollbar lib. Most of my use cases involving applying perfect-scrollbar to a ng2 component, which can't be done if this lib uses a component for wrapping.

Eg,

<suprematism-data-grid [suprePerfectScrollbar]="config">
  <suprematism-data-grid-row>...</suprematism-data-grid-row>
  ...
</suprematism-data-grid>

With this library, (unless I'm mistaken), users need to actually replace the element that would ordinarily be passed to PS.initialize, with your perfect-scrollbar component. I cannot replace the suprematism-data-grid element. Thus a directive made more sense for me.

The repo I pointed to doesn't have nearly the bells or whistles you've incorporated (eg, global configurations). I think a directive is the right way to go for this problem, though:

  1. Can be used on any element (rather than having to replace the element with the ng2 component)
  2. The perfect-scrollbar ng2 component doesn't use any styles or templates (other than projecting), so being a directive doesn't lose anything.
  3. It is easier to read / implement in an html file, imo.

Sorry if I'm inaccurate on these counts. Feel free to correct me! If you do go the path of a directive (rather than component) in a future release, I'll definitely start using this lib again. I like what you've done, just need as a directive.

from ngx-perfect-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.