GithubHelp home page GithubHelp logo

nicky-lenaers / ngx-scroll-to Goto Github PK

View Code? Open in Web Editor NEW
278.0 12.0 78.0 1.78 MB

Scroll to any element to enhance scroll-based features in you app. Works for Angular 4+, both AoT and SSR. No dependencies.

License: MIT License

TypeScript 87.04% JavaScript 5.65% HTML 5.65% Shell 0.26% SCSS 1.40%
angular ngx ngx-scroll-to angular-universal angular-aot angular4 angular2 scrolling smooth-scrolling scroll

ngx-scroll-to's People

Contributors

izmaylovdev avatar jonnyprof avatar sandrasmietana avatar smallhillcz avatar squelix avatar yanis-git avatar zakhenry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngx-scroll-to's Issues

Scroll doesn't work with *ngIF block content on version 0.5.0 - 0.5.3

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Scroll doesn't scroll if the div is hidden under IF Block only on v0.5.0 but works fine on v0.4.0

Expected behavior

It should scroll even if the block is hidden under *ngIf

Minimal reproduction of the problem with instructions

Just try scrolling to Block hidden under *ngIf on v0.5.0

What is the motivation / use case for changing the behavior?

It used everywhere

Environment


Angular version: 5.0.2


Your version of `@nicky-lenaers/ngx-scroll-to`: 0.5.0


Browser:
- [ x] Chrome (desktop) version XX
- [ x] Chrome (Android) version XX
- [x ] Chrome (iOS) version XX
- [ x] Firefox version XX
- [x ] Safari (desktop) version XX
- [ x] Safari (iOS) version XX
- [x ] IE version XX
- [x ] Edge version XX
 
For Tooling issues:
- Node version: Latest
- Platform:  Mac

Feature: Scroll offset instead of target

To continue the discussion at issue #10:
here is a snippet describing what I want to achieve with some comment to help clarify:

// this is called when a dialog is opened using the ngAfterViewInit- there's no clear event here to use.
let dialogElement = $(".dialog-content-for-scroll"); // this is the element I want to scroll, I can provide ElementRef if the ScrollTo API would accept it.
        dialogElement.delay(700)
            .animate({
                scrollTop: this.state.scrollPosition // I don't want to scroll to another element but rather to a position offset in "dialogElement"
            },
            "slow");
        dialogElement.on("scroll", () => {
            this.state.scrollPosition = dialogElement.scrollTop(); // this is used to get the current position when this dialog scrolls so that next time I open it, it will open in the same scroll position.
            this.sharedStorageService.set(OsmUserDialogComponent.OSM_USER_DIALOG_STATE_KEY, this.state);
        });

Here's my current implementation without JQuery:

class SomeComponenet {
...
@ViewChild("dialogContentForScroll") dialogContent: ElementRef;
...
public ngOnInit() {
...
        let dialogElement = this.dialogContent.nativeElement as HTMLElement;
        // the following is the code I want to replace with a service:
        setTimeout(() => dialogElement.scrollTop = this.state.scrollPosition, 700);
        // end, below code is fine as is.
        dialogElement.onscroll = () => {
            this.state.scrollPosition = dialogElement.scrollTop;
            this.sharedStorageService.set(OsmUserDialogComponent.OSM_USER_DIALOG_STATE_KEY, this.state);
        }
...

Target is in different component

Target destination is in different component


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ x] Feature request
[ ] Documentation issue or request

Safari always scrolls to top

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

JUST IN SAFARI, always scrolls to top of the page or doesn't work at all. (didn't test in iOS)

Expected behavior

Should work the same as in Chrome


Angular version: 5.2.3.

Your version of `@nicky-lenaers/ngx-scroll-to`: 3

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ x ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version:  v8.9.4
- Platform:  MacOS

Custom Easing Logic

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

No custom easing logic input

Expected behavior

Custom easing logic

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Scroll doesnt work with IF block content on version 0.5.0

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Scroll doesn't scroll if the div is hidden under IF Block only on v0.5.0 but works fine on v0.4.0

Expected behavior

It should scroll even if the block is hidden under

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z


Your version of `@nicky-lenaers/ngx-scroll-to`:


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Fix Indenting

This is mainly an issue to test the generation of the CHANGELOG.md file

No scrollable parent found for element BUTTON on ngFor

[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Hi there,
First, thanks for the plugin.
I am having a click issue (as far as i know, i am doing all as written :))...
On click i get "Error: No scrollable parent found for element BUTTON".

Template

<ion-row  >
    <button *ngFor="let item of data" class="chapter_title" [ngx-scroll-to]="item.title">{{item.title}}</button>
  </ion-row> 
  <ion-row *ngFor="let item of data" id="{{item.title}}">
    <ion-card class="cube_white" >
      <ion-card-header>
        <h3>{{item.title}}</h3>
      </ion-card-header>
      <ion-card-content>
        <div id="{{item.title}}">{{item.content}}</div>
      </ion-card-content>
    </ion-card>
  </ion-row>

The event

public triggerScrollTo($event: Event, itemIndex) {
    console.log(itemIndex);
    const config: ScrollToConfig = {
      target: itemIndex
    }
    this._scrollToService.scrollTo($event, config);
  }

The error output

Runtime Error
No scrollable parent found for element BUTTON
Stack
Error: No scrollable parent found for element BUTTON
at ScrollToService._getFirstScrollableParent (http://localhost:8100/build/vendor.js:57058:15)
at ScrollToService._start (http://localhost:8100/build/vendor.js:56988:30)
at ScrollToService.scrollTo (http://localhost:8100/build/vendor.js:56971:21)
at http://localhost:8100/build/vendor.js:118910:60
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9967)
at Object.onInvokeTask (http://localhost:8100/build/vendor.js:4499:37)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9888)
at r.runTask (http://localhost:8100/build/polyfills.js:3:5143)
at invoke (http://localhost:8100/build/polyfills.js:3:10945)
at n (http://localhost:8100/build/polyfills.js:2:28549)

Environment

Ionic Framework: 3.6.0
Ionic App Scripts: 2.1.4
Angular Core: 4.1.3
Angular Compiler CLI: 4.1.3
Node: 6.10.0
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36

Browser:

  • [x ] Chrome (desktop) version XX
  • [ x] Chrome (Android) version XX
  • [ x] Chrome (iOS) version XX
  • [ x] Firefox version XX
  • [ x] Safari (desktop) version XX
  • [ x] Safari (iOS) version XX
  • [ x] IE version XX
  • [ x] Edge version XX

Scroll completion callback

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

Current behavior

No way to execute a callback after scrolling has completed

Expected behavior

define a config parameter for a completion callback

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

I want to execute additional animations after the scrolling.

Environment


Angular version: X.Y.Z


Your version of `@nicky-lenaers/ngx-scroll-to`:


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

ScrollToTop

Is there a feature to Scroll to the Top of the Page?

ngx-scroll-to interferes with ngrx store

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

I have an Angular project that uses ngrx as a redux store. Everything works fine.

I've successfully installed ngrx-scroll-to and it works like a charm.

Here is the thing though. Once you have pressed a button that contains the ngrx-scroll-to directive, I get errors when I dispatch ngrx actions. Any actions dispatched before the button was pressed works fine.

This is the error that is output to the console:

RedeemFundsComponent.html:272 ERROR TypeError: toISOString is not a function
at String.toJSON ()
at Object. (vendor.bundle.js?=2.1.0-beta.1:1)
at derez (:1:65467)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:65906)
at derez (:1:66088)
at derez (:1:66088)
at derez (:1:65906)
at derez (:1:66088)
at derez (:1:65906)

And this is the error that I catch when I pause on exception:

TypeError: Converting circular structure to JSON.

Expected behavior

ngx-scroll-to should not interfere with ngx actions.

I am not really looking for a fix here, I am rather just looking for some guidance on how to debug this issue and to get the 2 libraries working together.

Environment


Angular version: 4.4.6


Your version of `@nicky-lenaers/ngx-scroll-to`:0.6.0


Browser:
- [X] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Update dependency to angular 5

Hi,

Current package shows an npm warning when installed with angular 5.0.
Can the dependency be updated?

npm WARN @nicky-lenaers/[email protected] requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.

Add support for "visibilityBased" option

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

Expected behavior

I would like to have a new option, called "ngx-scroll-to-visibility-based", or something like this.
By default it should be false. If it's set to true, scroll should happen only if not the entire target is visible already.
The condition to do the actual scroll is supposed to be something like this:


targetBottomPos < currentScrollTopPos || targetTopPos > currentScrollBottomPos || targetBottomPos > currentScrollBottomPos

What is the motivation / use case for changing the behavior?

Imagine an accordion-style hierarchical menu. The user clicks on a parent menu: this event closes up the previously opened submenu items and opens (slides down for example) the current parent menu's submenu items. At this point it can easily happen that the opened items get out of the view. In this case we want to scroll to the freshly opened menu items. On the other hand if the entire freshly opened submenu items are visible without scroll, we don't want the site to do any scroll.

How ngx-scroll-to can trigger scroll when page load?

Here my code

<p><a [routerLink]="['/red']" [ngx-scroll-to]="'red'">Red</a> |
<a routerLink="/green" [ngx-scroll-to]="'green'">Green</a> |
<a routerLink="/blue" [ngx-scroll-to]="'blue'">Blue</a></p>

<div class="content">
        <blue-router></blue-router>
	<red-router></red-router>
	<green-router></green-router>
</div>

Is possible ngx-scroll-to can scroll when i enter "http://localhost:4200/blue"?
Is possible ngx-scroll-to can working back history?

Pass function to [ngx-scroll-to-offset]

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

Current behavior

Currently [ngx-scroll-to-offset] only supports numbers. This could be a potential problem for, let's say, a mobile layout with a fixed header. For desktop, the offset could be different than for the mobile layout. Ideally, as a user of this library, I would like to be able to pass a function to [ngx-scroll-to-offset] which gets called and returns a value for the offset

Expected behavior

<button [ngx-scroll-to-offset]="calcHeightOffset">Click</button>

The function could be something like:

@Input() calcHeightOffset = () => {
    if(mobile){
        return 80;
    }
    return 100;
}

What is the motivation / use case for changing the behavior?

See 'current behaviour'

Can't bind to 'ngx-scroll-to' since it isn't a known property of 'button'

Getting this strange error and unable to make it work.
followed the basic steps in the doc.

VM8855 core.js:1655 ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'ngx-scroll-to' since it isn't a known property of 'button'. (" {{user.lastName}}

<button type="button" [ERROR ->][ngx-scroll-to]="'userdetails'" class="btn btn-info btn-sm" aria-label="Left Align" (click)="showUser"): ng:///ArgModule/UsermanagementComponent.html@30:40
Error: Template parse errors:
Can't bind to 'ngx-scroll-to' since it isn't a known property of 'button'. (" {{user.lastName}}

Option for interruptable scrolling

Provide an option to enable/disable interrups during scrolling.

Proposed directive:
[ngx-scroll-to-interruptable]

Type
boolean

Default
false

Accepts
Any boolean value

update readme

remove accepts table column (this is already clear in type column)

Offset configuration acts as negative value when scrolling from bottom to top

Hi!
When I am using offset option and the scrolling happens from the bottom to the top, it seems that the offset is acting as a negative value.

To clarify (using offset 200 for example):

  • target.offsetTop > document.body.scrollTop - everything works fine, scrolls to target.offsetTop + 200px
  • target.offsetTop < document.body.scrollTop - scrolls to target.offsetTop - 200px, instead of + 200px

I am not sure, is it happening only for me, but if it doesn't, would you please add offsetTop option to scroll configurations as well?

Incorrect offsetTop for non-target scroll position inside a container

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Offset is incorrectly calculated inside a container.

Expected behavior

Correct calculation.

Minimal reproduction of the problem with instructions

See examples from discussion in issue #28

Using module with SSR from angular cli gives import error

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Our SSR app is built using this guide: https://github.com/angular/angular-cli/wiki/stories-universal-rendering and works well. However if you npm install --save this module you get:

import xyz
^^^^^^
SyntaxError: Unexpected token import

when you run in on the server with "node server.js"

It works very well if we just build it in our app, Thanks!

Expected behavior

It runs on the server.

Minimal reproduction of the problem with instructions

Build a SSR app using the above guide. I could start over an make one if you want?

What is the motivation / use case for changing the behavior?

Works on the server.

Environment


Angular version: 4.2.4

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  v6.11.2 
- Platform:  Mac

Others:

Feature: Using a service from inside a component to scroll

I couldn't find it in the documentations - I would like to achieve the following:
I have a component that is a pop-up, and I want to scroll to the same location the user left it when it was closed.
So I need two functionalities

  1. The ability to smooth scroll to a position.
  2. The ability to receive scroll events to update a local variable that stores the current scroll position.
    Currently I'm using JQuery. I would like to remove this dependency if possible and I thought this library might do the trick.
    I also looked at smoothscroll-polyfill but I'm not sure it will do what I need.
    Thoughts are appreciated.

Detect if element is visible and abort scroll if it is

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

Current behavior

None

Expected behavior

Some kind of option to prevent scrolling if the element is already visible within the parent container

What is the motivation / use case for changing the behavior?

I have an element that any given time when the scroll function is triggered I don't currently know if it's visible or not. It doesn't make sense from a usability standpoint to have scrolling when it's already visible to the user. At least having the option to abort scrolling if visible would prevent animations from executing that provide no real help for the user.


Angular version: 4.2.4


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

Not working in Edge or IE

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x ] Bug report>
[ ] Feature request
[ ] Documentation issue or request

Current behavior

There isn't much to say. The module works flawlessly in Chrome and Firefox but in Edge and IE (11) doesn't react on click at all.

Expected behavior

Working on all browsers.

Environment


Angular version: 4.4.6


Your version of `@nicky-lenaers/ngx-scroll-to`: v0.6.0

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ x ] IE version 11.371.16299.0
- [ x ] Edge version 41.16299.371.0
- [ x ] EdgeHTML version 16.16299

Probably also lesser versions of IE.
 
For Tooling issues:
- Node version: v8.9.1
- Platform:  Windows 10

@nicky-lenaers/ngx-scroll-to@"<1" not working

I'm submitting

A npm install issue for ngx-scroll-to

Current behavior

When using npm install @nicky-lenaers/ngx-scroll-to@"<1" it replies with the following:
"The system cannot find the file specified."

Expected behavior

For npm install @nicky-lenaers/ngx-scroll-to to work for angular versions before 6

Environment

Angular version:
angular/cli: 1.7.1
angular-devkit/build-optimizer: 0.3.2
angular-devkit/core: 0.3.2
angular-devkit/schematics: 0.3.2
ngtools/json-schema: 1.2.0
ngtools/webpack: 1.10.1
schematics/angular: 0.3.2
schematics/package-update: 0.3.2
typescript: 2.5.3

For Tooling issues:

  • Node version: 5.6.0
  • Platform: Windows

Other:
This is the first issue I am reporting so forgive me for any mistakes. I did check if the issue is already published but could not find anything. To me it seems as though older versions do not exist.

Scrolling is always interruptible by mousewheel events

I'm submitting a...


[x ] Documentation issue or request

Current behavior

When I set .scrollTo() , the scrolling animation can be interrupted by the user.
I tried setting event.preventDefault() and also setting the css property pointer-events: none

Expected behavior

It should prevent any scrolling actions untill the animation completes

Environment


Angular version: 5.0.3


Your version of `@nicky-lenaers/ngx-scroll-to`: 0.6.0


Browser:
- [x ] Chrome (desktop) version 65

Feature: Enable scrolling for targets in a different container

Hi,
So in one div I have my anchors which I click for scrolling and in another one are the targets to scroll to.
This usecase is not working. Here's a plunkr for you to see:
https://plnkr.co/edit/y345JeEKeOz4pv9maZaV?p=preview

Am I setting something wrong, or is it not possble?

Thanks

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Angular version: 4

Scrolling on IE and Edge?

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[x] Documentation issue or request

Current behavior

Doesn't scroll with click of button.

Expected behavior

To scroll too targeted id.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Angular version: X.Y.Z
Angular CLI: 1.6.8
Node: 8.6.0
OS: win32 x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0


Your version of `@nicky-lenaers/ngx-scroll-to`:
release 0.5.3

Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [x] IE version 11
- [x] Edge version 41
 
For Tooling issues:
- Node version: v8.6.0  
- Platform: Windows 

Others:

Support element target

I'm using ng2-scroll-to which seems to be working fine with angular 4 but has a warning for old dependencies of angular 2, which is annoying, also the name is not great.
I wanted to switch to this library but I'm missing a feature:
scrollableElementSelector - which defines which element should be scrolled (the container, as apposed to which element to scroll to).
Am I missing something?

Unable to find Target Element - suppress this message when we don't care?

I'm submitting a request / bug

    const config: ScrollToConfigOptions = {
        container: '#some-wrapper',
        target: '#someIdNotOnPage
    };
    this.scrollToService.scrollTo(config).

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x ] Feature request
[] Documentation issue or request

Current behavior

When trying to call the service to scroll to an element that does not exists, and there's no way to suppress the error being created in the console. It

Expected behavior

Ability to capture and handle the error "Unable to find Target Element". A developer could handle this error how they want. do nothing or throw the issue.

What is the motivation / use case for changing the behavior?

I am aware that the error will occur and it is normal behavior, I want to simply suppress the issue as in my case it is not.

Scrolling does not work when inside an Angular Material Sidenav

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report 
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Scrolling does not work when inside an Angular Material Sidenav.

Expected behavior

For it to work.

Minimal reproduction of the problem with instructions

Here is a stackblitz of it not working in Angualar Material Sidenav. if I take it out of the sidenav component then the scrolling will work.

https://stackblitz.com/edit/angular-37wifk

What is the motivation / use case for changing the behavior?

I would like to use this product with Angular Materials

Your version of @nicky-lenaers/ngx-scroll-to:
Using latest version

Browser:

  • [X ] Chrome (desktop) version 63
  • Chrome (Android) version XX
  • Chrome (iOS) version XX
  • Firefox version XX
  • Safari (desktop) version XX
  • Safari (iOS) version XX
  • IE version XX
  • Edge version XX

Stop loop code

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ x] Bug report  
[ ] Feature request
[ ] Documentation issue or request

Current behavior

the animation never stops (tested with easeOutElastic). Side effects are for example arrow keys are not working for scrolling and also a interval is running which might slow down the webapp

Expected behavior

the animation to stop ( the loop code to stop running)

Minimal reproduction of the problem with instructions

I just installed it via npm and used the service
Here is a debugger where the animation is done but the intervall is still running
image
Because the this._position is a float it never is exactly equal to this._to + this._options.offset the interval is not cleared. The stop code is never stopping to run even though scroll has reached its point.
DOES not happen if I use easeInQuad for example


this.scrollToService.scrollTo({
					target: '#order-search-result-row-with-table',
					duration: 650,
					easing: 'easeOutElastic',
					offset: 0
				})

What is the motivation / use case for changing the behavior?

arrow keys are not working for scrolling and also a interval is running which might slow down the webapp

Environment


Angular version: 5.2.1


Your version of `@nicky-lenaers/ngx-scroll-to`:
0.5.0

Browser:
- [x ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 
- Platform:  windows

Others:
nothing

Add scroll support to elements with "overflow" property set to "overlay"

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[] Bug report 
[X] Feature request
[ ] Documentation issue or request

Current behavior

Scroll is not working when the scrollable element has "overflow: overlay". From a quick peek on the code, I noticed that only "overflow:auto" and "overflow:scroll" are being checked.

const overflowRegex: RegExp = /(auto|scroll)/; in scroll-to.service.ts

Expected behavior

Scroll should work to a scrollable element that has "overflow:overlay".

Ability to call scrollTo without event

This is a follow-up on #20 . As soon as this is implemented, the scrollTo function will be available to be called without an event, since the event is now needed to search for the first scrollable parent.

Use passive events

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

Current behavior

The document listeners doesn't use the passive event to improve the performance.
Info: https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners

Expected behavior

Use the passive events.

What is the motivation / use case for changing the behavior?

To improve the performance using the library.

Environment


Angular version: 5.2.10

Your version of `@nicky-lenaers/ngx-scroll-to`: 0.6.0

Browser:
- [x] Chrome (desktop) version XX
- [x] Chrome (Android) version XX
- [x] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [x] Safari (iOS) version XX
- [x] IE version XX
- [x] Edge version XX
 
For Tooling issues:
- Node version: v9.11.1
- Platform:  MAC OS X

[Question] How to use service without event parameter?

Hi,

I want to use your library in my project but I saw that I need to provide an event parameter if I want to use the scroll service. Is there a way to bypass this?
Also I wonder if this library will work with my complex view.

Root
  - Header
  - Content
      - Carousel
      - Carousel
      - EPG <-- 24h programs
          - Program
          - Program <-- currently playing
          ...

I need to scroll to the currently playing program when the Content is loaded. How can I use ngx-scroll-to to achieve this?

Not working for ngIf

Add ability to scroll to element that's originally hidden by ngIf. Should be done by animating after the Angular lifecycle hook

Make compatible with Angular 6

ng update rxjs

Package "@nicky-lenaers/ngx-scroll-to" has an incompatible peer dependency to "rxjs" (requires "^5.4.2", would install "6.1.0").

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.