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

Wait until scrolling stops in ie11? #57

Closed
getsetbro opened this issue Nov 8, 2019 · 5 comments
Closed

Wait until scrolling stops in ie11? #57

getsetbro opened this issue Nov 8, 2019 · 5 comments
Labels
inactivity No answer received within one week or more. question Further information is requested. Awaiting response. review Issue probably fixed. Awaiting response.

Comments

@getsetbro
Copy link

Everything is great in latest browser but janky in ie11. Can we add a debounce or wait until scrolling stops before positioning the element?

@ghost
Copy link

ghost commented Nov 11, 2019

hello @getsetbro, just tested with ie11 but wasn't facing any problems. what do you mean by janky? could you provide a screencast of your observed behavior and describe the expected behavior. thanks.

@ghost ghost added question Further information is requested. Awaiting response. review Issue probably fixed. Awaiting response. labels Nov 11, 2019
@getsetbro
Copy link
Author

getsetbro commented Nov 11, 2019 via email

@ghost
Copy link

ghost commented Nov 11, 2019

Hello @getsetbro we've just released v1.2.3. You are now able to set the property auditTime. The auditTime operator is then set on the source observable of the scroll event. Be aware, that values too high will also lead to glitchy behavior. Hope this helps and maybe you can tweak it a little bit with this option.

@getsetbro
Copy link
Author

  1. How do I use it?
  2. I am wanting to set this only for the browsers that do not support position:fixed such as ie11.

@ghost
Copy link

ghost commented Nov 12, 2019

You could use a variable in your component class where you use the sticky thing directive.

@Component{...}
class ComponentUsingStickyDirective implements OnInit {
    auditTime;
    ngOnInit() {
        // @see https://stackoverflow.com/questions/48182912/how-to-detect-browser-with-angular#48183194
        const isIEOrEdge = /msie\s|trident\/|edge\//i.test(window.navigator.userAgent)
        // if isIEOrEdge equals true then auditTime is e.g. 300 if not 0
        this.auditTime = isIEOrEdge ? 300 : 0;
    } 
}

Then in the corresponding html you could bind the auditTime to the auditTime input of your sticky element(s).

<section #boundary>
    <div #spacer></div>
    <div stickyThing="" [auditTime]="auditTime" [boundary]="boundary" [spacer]="spacer">
        Your Sticky Content
    </div>
</section>

@ghost ghost added the inactivity No answer received within one week or more. label Nov 26, 2019
@ghost ghost closed this as completed Nov 26, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactivity No answer received within one week or more. question Further information is requested. Awaiting response. review Issue probably fixed. Awaiting response.
Projects
None yet
Development

No branches or pull requests

1 participant