sticky-state | high performant module making native position : sticky | Frontend Framework library

 by   soenkekluth JavaScript Version: 2.4.1 License: No License

kandi X-RAY | sticky-state Summary

kandi X-RAY | sticky-state Summary

sticky-state is a JavaScript library typically used in User Interface, Frontend Framework, React Native, React applications. sticky-state has no bugs, it has no vulnerabilities and it has low support. You can install using 'npm i sticky-state' or download it from GitHub, npm.

StickyState adds state to position:sticky elements and also polyfills the missing native sticky feature. Dependency free, pure Javascript for IE9+. Today's browsers do not all support the position:sticky feature (which by the way is being used (polyfilled) on pretty much every site you visit) - moreover the native supported feature itself comes without a readable state. Something like a:hover => div:sticky to add different styles to the element in its sticky state - or to read the state if needed in JavaScript. Unlike almost all polyfills you can find in the wild, StickyState is highly performant. The calculations are reduced to a minimum by persisting several attributes. In some cases you also need to know in which direction the user scrolls - for example if you want to hide a sticky header when the user scrolls up. if you set the scrollClass property of the options StickyState will add your choosen classNames to the element when it is sticky and scrolling. As a standalone Library its 6.75kb gzipped.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sticky-state has a low active ecosystem.
              It has 686 star(s) with 31 fork(s). There are 13 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 19 have been closed. On average issues are closed in 49 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of sticky-state is 2.4.1

            kandi-Quality Quality

              sticky-state has 0 bugs and 0 code smells.

            kandi-Security Security

              sticky-state has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              sticky-state code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              sticky-state does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              sticky-state releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              Installation instructions are not available. Examples and code snippets are available.
              sticky-state saves you 345 person hours of effort in developing the same functionality from scratch.
              It has 826 lines of code, 0 functions and 12 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed sticky-state and discovered the below as its top functions. This is intended to give you an instant insight into sticky-state implemented functionality, and help decide if they suit your requirements.
            • Sticky state constructor
            • Creates an instance of StickyState .
            • Canvas .
            • find module name
            • Inherit one class into another
            • Returns the result of this method if it doesn t exist
            • Check if a constructor is a function
            • interpolate the default module
            • Define properties on an object .
            • Define a number
            Get all kandi verified functions for this library.

            sticky-state Key Features

            No Key Features are available at this moment for sticky-state.

            sticky-state Examples and Code Snippets

            No Code Snippets are available at this moment for sticky-state.

            Community Discussions

            QUESTION

            position:sticky doesn't work together with display:flex on IE 11
            Asked 2019-Jan-29 at 15:14

            I'm trying to make the position: sticky and display: flex properties work on Internet Explorer 11.

            It works great on Chrome, Firefox, and Edge, but, surprise surprise; it doesn't work on Internet Explorer 11.

            ...

            ANSWER

            Answered 2019-Jan-29 at 15:09

            According to caniuse.com position: sticky is not supported in IE11 and display: flex have partial support because lots of bugs.

            I don't have much experience with StickyState but I use StickyBits and it works just fine.

            EDIT:

            Working example

            Source https://stackoverflow.com/questions/54422082

            QUESTION

            Angular Sticky States in Angular 2+
            Asked 2018-Feb-05 at 07:28

            I'm migrating a Angular 1.5.X app to Angular 4. In my App I use Angular Ui-Router Sticky State https://github.com/ui-router/sticky-states to avoid lose the content of my view when I made a navigation in some views of my APP but when I try to use this functionality in ng-router2 I can't find it. https://ui-router.github.io/ng2/tutorial/helloworld.

            Some one know some router with similar function to Sticky State in Angular2+ or use the ui-router-ng2 to emulate the Sticky State.

            ...

            ANSWER

            Answered 2018-Feb-05 at 07:28

            I found this answer on internet I cant remember the web but the solution is not mine.

            Source https://stackoverflow.com/questions/45878698

            QUESTION

            Ui-router State Change: Keep Controller and Scope but Destroy DOM
            Asked 2017-Mar-28 at 22:23

            I am using ui-router 1.0.0-beta.3, angular 1.5. So far, ui-router is awesome!

            I have a root state, with some child states so far, but I noticed switching between siblings (children of the same root parent) causes complete recreation of the state I transition/go to.

            I'd like to keep the scope variables around because, in my app, users may toggle some buttons, enter dates, etc, then maybe switch to another state, do something, and switch back but now all their partial work is gone. I'd also like the option to be able to destroy DOM for "inactive" states since in practice some of the states can get pretty large or users might create a lot of DOM so I'd like to keep the DOM as light as possible for some states.

            I understand that ui-router-extras sticky-states feature is exactly this! And I could use the $state.includes function to target when I want to destroy DOM on some components. However, it seems ui-router-extras does not work with ui-router 1.0.0-beta.3. The author did make a port for the newer ui-router, but the release is in typescript and I am not sure how to compile that into a single js file. See: https://github.com/ui-router/sticky-states/issues/4

            Perhaps I need a solution that does not use sticky-states --- any ideas? I was thinking of using a service to cache the scope values, and indeed read some other SO answers to that affect. This means that, per component, I'd need to handle which scope values to cache, etc. This is definitely a possibility, but I am wondering if anyone has any other techniques or knowledge about ui-router such that maybe there is another way to accomplish what I am after: cached controller/scope on transition change.

            ...

            ANSWER

            Answered 2017-Mar-28 at 22:23

            After reading the author's typescript source code (which was a pleasure, very well-written code) from:

            https://github.com/ui-router/sticky-states/blob/master/src/stickyStates.ts

            I decided to migrate it to my own service in javascript, which would be compatible with ui.router 1.0.0-beta.3. By the way, ui.router 1.0.0-beta.3 is available at:

            https://unpkg.com/angular-ui-router@1.0.0-beta.3/release/angular-ui-router.js

            My approach was: because 1.0.0-beta.3 appears to not have the onCreate transition hook, I would decorate the $transitions.create function itself. To do this, I needed to inject a lot of helper functions and the core functionality of sticky states into the decoration. So I made the StickyStatesUtil provider to do this for me.

            The migration consists of 2 parts: (1) a module called sticky-states-util, which creates the StickyStatesUtil provider, as well as a useful service for checking if a state/state-name is inactive, and an inactiveEvent, which, if set to a value, will cause $rootScope to broadcast a json map of inactive state-names for anything in the app to consume. If not set, that is skipped. And (2), the actual config block in the angular app that injects $provide and uses that to decorate the $transitions service with a new "create" function.

            Since a couple others are in the same spot as me, I made this code available on github:

            https://github.com/dsills22/sticky-states-ui-router-1-js

            Source https://stackoverflow.com/questions/42914806

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sticky-state

            You can install using 'npm i sticky-state' or download it from GitHub, npm.

            Support

            IE >= 9, *.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i sticky-state

          • CLONE
          • HTTPS

            https://github.com/soenkekluth/sticky-state.git

          • CLI

            gh repo clone soenkekluth/sticky-state

          • sshUrl

            git@github.com:soenkekluth/sticky-state.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link