angular / angular/components

Virtual scroll collectionViewer.viewChange does not emit when direction is 'rtl'

Aperta
#24,269 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area: cdk/scrolling P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

I'm using a `cdk-virtual-scroll-viewport` with `dir='rtl'`, connected to a _CdkDataSrouce_. When scrolling, the `viewChange` event is not emmited, and though I can't load more items as I go. The same code works if I change the direction to `ltr`.

### Reproduction

My template looks like this:
```


...

```

=> where `dataConnector` is my extension of a `CdkDataSrouce`

I think it might be related to having a negative `scrollOffset` when in `rtl` direction.

### Expected Behavior

I am expecting `collectionViewer.viewChange` to fire when I scroll to the left.

### Actual Behavior

It does not fire if the `dir` property is `rtl`

### Environment

- Angular: 12.0.4
- CDK/Material: 12.0.4
- Browser(s): Chrome Version 97.0.4692.71 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 64-bit

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziate dal comportamento di cdk-virtual-scroll-viewport descritto nella riproduzione e tracciate l’interazione tra lo scorrimento RTL, i valori negativi di scrollOffset e collectionViewer.viewChange. Riproducete il template fornito con Angular/CDK 12.0.4, quindi verificate che lo scorrimento verso sinistra in rtl emetta viewChange, in modo da poter caricare elementi aggiuntivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.