angular / angular/components

bug(material/datepicker): There is no way to deselect the selected date(s) while a calendar is open

Ouverte
#29,877 1 commentaire 2 réactions 0 personnes assignées Voir sur GitHub
area: material/datepicker P2
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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 have a reset button in the date range picker, but when I try to reset the selected dates using the reset button, it resets the models but not the selection in the date range picker widget.

![Image](https://github.com/user-attachments/assets/597ce098-3598-4d91-87a5-712627d075b0)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/4wfp1v-mbnz3s?file=src%2Fexample%2Fdate-range-picker-overview-example.html

Steps to reproduce:
1. Open the date range picker widget.
2. Select a date range.
3. Click the reset button.
4. Observe that while the underlying models are reset, the date selection in the date range picker widget remains unchanged.

### Expected Behavior

I was expecting the date range picker widget to completely clear the selected dates and reset to its default state when the reset button is clicked, along with resetting the underlying models.

### Actual Behavior

The actual behavior is that when the reset button is clicked, the underlying models are reset, but the selected dates in the date range picker widget remain highlighted and do not clear.

### Environment

- Angular: ^19.0.0-next.2
- CDK/Material: ^19.0.0-next.2
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows and Ubuntu

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée, plus précisément par src/example/date-range-picker-overview-example.html, et reproduisez le flux de réinitialisation dans le date-range picker. Suivez le comportement du widget après l’effacement des modèles et identifiez les tests pertinents de Material date-range picker ; la tâche est terminée lorsque le bouton de réinitialisation efface à la fois les modèles et la sélection de date mise en évidence.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.