angular / angular/components

bug(chip): chip selection state does not match [selected] v19.1.1

Đang mở
#30,527 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: material/chips P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### Is this a regression?

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

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

19.1.0

### Description

I have a component with selectable stacked chips with drag drop to rearrange/toggle columns of my table.

after 19.1.1 update moving deselected chip changes the selection of other chips not respecting the [selected] in mat-chip-option

### Reproduction

I have create a minimal reproduction of the issue

https://github.com/Siddhu-K/chip-drag

toggle chips and drag drop.

```

@for (i of chip_list(); track i; let index = $index) {

{{ index + 1 + ". " + i.name + " - " + i.selected }}

}

```

### Expected Behavior

actual selection should match [selected] in the mat-chip-option

### Actual Behavior

actual selection does not match [selected] in the mat-chip-option

### Environment

Angular CLI: 19.1.8
Node: 22.13.0
Package Manager: npm 11.1.0
OS: win32 x64

Angular: 19.1.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1901.8
@angular-devkit/build-angular 19.1.8
@angular-devkit/core 19.1.8
@angular-devkit/schematics 19.1.8
@angular/cdk 19.1.5
@angular/cli 19.1.8
@angular/material 19.1.5
@schematics/angular 19.1.8
rxjs 7.8.1
typescript 5.7.3
zone.js 0.15.0

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện tối thiểu được liên kết tại github.com/Siddhu-K/chip-drag và tái hiện sự cố bằng cách chuyển đổi các chip, sau đó kéo một chip đã bỏ chọn. Theo dõi tương tác giữa mat-chip-listbox, mat-chip-option [selected] và cdkDropList. Hoàn tất khi lựa chọn được hiển thị vẫn nhất quán với giá trị selected của từng chip sau khi sắp xếp lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.