Mat Stepper needs a beforeSelectionChange event
- 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ả
### Feature Description
There should be an event that is triggered when you attempt to navigate to a different step via the mat stepper header.
Currently, there is only a `selectionChange` event that doesn't get triggered until _after_ the next navigation takes place.
### Use Case
In my scenario, when a user attempts to navigate to the next step, I need to first call an endpoint to validate the data they entered. Once I have validated that the data is correct, I can proceed to the next step with `stepper.next()`. This works as expected if the user clicks on my next button with a custom `(click)` event, but if they click on the header to navigate, there is no way to call the endpoint before navigation.
Using `selectionChange` does not work, because there is no way to prevent navigation after the `StepperSelectionEvent` has happened.
Alternatively, instead of a `beforeSelectionChange` event, if there were a way to prevent the next navigation when subscribing to the `selectionChange` event, that would also work. Or if there was a way to prevent navigation from the header, but still capture clicks, so that `stepper.next` could manually be called.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với điều hướng tiêu đề của mat stepper và sự kiện selectionChange hiện có, sau đó so sánh luồng đó với entry point stepper.next() được mô tả trong issue. Thay đổi hoàn tất khi việc điều hướng tiêu đề có thể được xác thực hoặc ngăn chặn trước khi chọn, trong khi điều hướng theo chương trình đến bước tiếp theo vẫn tiếp tục hoạt động.
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
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- 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
- 30/100