angular / angular/components

bug(MatDatePicker): change events emitted despite using emitEvents false

Aperta
#20,218 22 commenti 34 reazioni 0 assegnatari Vedi su GitHub
area: material/datepicker needs: discussion P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Reproduction

https://stackblitz.com/edit/components-issue-xay9ty?file=src%2Fapp%2Fexample-component.ts

1. Click the "emitEvent: false" button

#### Expected Behavior

`valueChanges` should not emit values when setting a value with `emitEvent: false`

This works correctly for "normal" input components, but not when attaching a date picker.

The reproduction includes a text input and a select for comparison.

#### Actual Behavior

Using `setValue` or `patchValue` with `emitEvent` set to `false` has the `valueChanges` observable emit changes.

#### Environment

- Angular: 10.0.3
- CDK/Material: 10.0.3
- Browser: Chrome
- Operating System: Windows

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Apri la riproduzione StackBlitz collegata e analizza src/app/example-component.ts. Fai clic sul pulsante "emitEvent: false", confronta il comportamento del date-picker con quello dell'input di testo e del select e traccia le emissioni di valueChanges. Il lavoro è completato quando setValue e patchValue con emitEvent: false non producono emissioni di valueChanges per il date-picker.

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
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.