bug(material-date-fns-adapter): MatDateFnsAdapter not imported into standalone dialog component
- 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 not sure if it is a bug or just how it works atm, but when using a MatDatepicker with MatDateFnsModule it will not find the DateAdapter when using this in a standalone dialog component. (it's working in all other standalone components which are not a dialog).
If I add the MatDateFnsAdapter to the imports of the component which opens the dialog, everything is fine. But with standalone components I usually expect the imports in the component that really needs it.
I prepared a StackBlitz example.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-35ebyd?file=src%2Fmain.ts
Steps to reproduce:
1. Wait for the dev server to load
2. Click "Open Dialog"
3. Click on the calendar icon in the input field
4. See the console log
### Expected Behavior
No error message should appear on the console and the datepicker should open.
### Actual Behavior
Datepicker does not open because of the console error.
### Environment
- Angular: 16.2.11
- CDK/Material: 16.2.11
- Browser(s): Edge, Chrome
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo la riproduzione StackBlitz collegata da src/main.ts e segui la configurazione della finestra di dialogo standalone descritta nell’issue. Conferma l’errore di lookup di MatDateFnsAdapter all’apertura del datepicker, quindi verifica che il datepicker si apra senza errori nella console, mantenendo l’import dell’adapter locale al componente che ne ha bisogno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100