ng2-scroll-to icon indicating copy to clipboard operation
ng2-scroll-to copied to clipboard

ScrollOffset not working

Open KissBalazs opened this issue 8 years ago • 6 comments

<button scrollTo scrollOffSet="400" scrollTargetSelector="#{{progessBarNavRefs[i]}}"> This code scrolls to the target selector, but I cannot force it to use the given offset. What is the correct syntax?

KissBalazs avatar Oct 06 '17 09:10 KissBalazs

You need to add a file https://github.com/drusso85/ng2-scroll-to/blob/master/src/scrollTo.ts to \ng2-scroll-to\src

valentynbogoslavskiy avatar Oct 12 '17 10:10 valentynbogoslavskiy

Thank you for your answer! Is there a way to implement this in my source code instead of the node_modules folder? We need to use the app on different hosts in the future with clean npm install environment.

KissBalazs avatar Oct 12 '17 10:10 KissBalazs

@valentynbogoslavskiy I have created the file scrollTo.ts in the folder you suggested but is there anything else I need to do to make the offSet work?

guideveloper avatar Oct 13 '17 13:10 guideveloper

The latest version installed from NPM @ npmjs.com/package/ng2-scroll-to does not include ScrollOffSet at all in the node_modules/ng2-scroll-to/src/scrollTo.js source file.

This might be that it's old source code in the published NPM package (and the new code is correctly in the ng2-scroll-to/compiled/ folder).

However, it may also be a sign that @drusso85 needs to re-compile or re-publish the Node package to NPM with the ScrollOffSet update?

I've tried adding the updated file that @valentynbogoslavskiy suggests, but I am on Angular 5.0.0.3 and I have unmet peer dependencies stemming from the fact that my version numbers don't line up. The addition of the raw file did not work, and I feel dumb for missing a step (or 2) here.

jcmcallister avatar Jan 03 '18 17:01 jcmcallister

Proof that I am stupid: I copied the TypeScript TS file contents and overwrite the src/scrollTo.js file. Got it fixed and the ScrollOffSet template attribute is now functional for me.

jcmcallister avatar Jan 03 '18 17:01 jcmcallister

+1

cristianpoleyJS avatar Jan 09 '18 11:01 cristianpoleyJS