ng-mat-select-infinite-scroll icon indicating copy to clipboard operation
ng-mat-select-infinite-scroll copied to clipboard

Angular 15 compatibility with new and legacy components

Open Brachacz opened this issue 2 years ago • 4 comments

Hi,

currently this library blocks update to Angular 15 because it expects old version of MatSelectModule.

image

I'd like to request support for:

  • MatLegacySelectModule - changes and effort required to migrate whole styled app to new components would be massive, it's preferable to ease this transition by being able to stay on legacy components for now
  • new MatSelectModule - obvious

Cheers!

Brachacz avatar Jan 11 '23 14:01 Brachacz

Hello everyone,

I ran into same issue when I was upgrading to Angular 15. Due to some dependencies I have to use MatLegacySelectModule too. Do you have any updates regarding this issue? Thanks!

fgehmlich avatar Jan 25 '23 10:01 fgehmlich

Installing a temporary Angular CLI versioned 15.1.4 to perform the update. ✔ Packages successfully installed. Using package manager: npm Collecting installed dependencies... Found 45 dependencies. Fetching dependency metadata from registry... Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=4.6.2 <4.9", would install "4.9.5"). Package "ng-mat-select-infinite-scroll" has an incompatible peer dependency to "@angular/material" (requires ">=6.0.0 <15.0.0", would install "15.1.2").

AgustinTommasi avatar Feb 02 '23 16:02 AgustinTommasi

seems like ng-mat-select-infinite-scroll v 4 doesn't support angular 15 yet npm WARN [email protected] requires a peer of @angular/core@>=6.0.0 <15.0.0 but none is installed. You must install peer dependencies yourself.

naciriii avatar Feb 06 '23 15:02 naciriii

I think the issue that @Brachacz reported could be solved by providing a legacy directive for MatLegacySelect. This adjusted directive must import MatLegacySelect instead of MatSelect.

import { AfterViewInit, Directive, EventEmitter, Input, NgZone, OnDestroy, OnInit, Output } from '@angular/core';
import { MatLegacySelect as MatSelect } from '@angular/material/legacy-select';
import { fromEvent, Subject } from 'rxjs';
import { debounceTime, takeUntil, tap } from 'rxjs/operators';

/** The height of the select items in `em` units. */
const SELECT_ITEM_HEIGHT_EM = 3;

@Directive({
  selector: '[msLegacyInfiniteScroll]'
})
export class MatLegacySelectInfiniteScrollDirective implements OnInit, OnDestroy, AfterViewInit {...}

fgehmlich avatar Feb 06 '23 15:02 fgehmlich