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

[DRAFT] Angular 14 #1

Closed
wants to merge 4 commits into from

Conversation

majora2007
Copy link

@majora2007 majora2007 commented Nov 22, 2022

I have converted the library to Angular 14 which required strict typing. I have updated all but 2 lines, as those change logic flow. I'm open to any pointers on how to close those out.

Line 1:

protected debounce(func: Function, wait: number): Function {
    const throttled = this.throttleTrailing(func, wait);
    const result = function () {
      throttled['cancel']();
      throttled.apply(this, arguments); // this doesn't have a type and arguments isn't seen as []. I tried casting and using same type as throttleTrailing, but no luck
    };
    result['cancel'] = function () {
      throttled['cancel']();
    };

    return result;
  }

Line 2:

protected getScrollElement():  HTMLElement {
    return this.parentScroll instanceof Window ? (document.scrollingElement || document.documentElement || document.body) : (this.parentScroll || this.element.nativeElement);
  }

The problem is that document.scrollingElement is an Element type, while all others are HTMLElement. But in the code, we actually use properties only on HTMLElement and not Element.

If I could get any support on this, we can get Angular 14 out of the way and migrate up to 15 as well.

@majora2007
Copy link
Author

I ended up fixing throttled.apply(this, arguments); and removed one of the Elements for getScrollingBlock().

Trying to get the code running, but the demo doesn't see virtual scroller for some reason.

@majora2007
Copy link
Author

@iharbeck any chance you could review this and give me some suggestions on how to properly test this out?

@majora2007 majora2007 closed this Jan 2, 2023
iharbeck pushed a commit that referenced this pull request Nov 16, 2023
Add container offset to scrollbar length
iharbeck pushed a commit that referenced this pull request Nov 16, 2023
iharbeck pushed a commit that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant