angular / angular/components

Mat Stepper needs a beforeSelectionChange event

Abierto
#30,292 1 comentario 3 reacciones 0 asignados Ver en GitHub
area: material/stepper feature P4
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la navegación del encabezado de mat stepper y el evento selectionChange existente, y luego compara ese flujo con el punto de entrada stepper.next() descrito en el issue. El cambio estará completo cuando la navegación del encabezado pueda validarse o impedirse antes de la selección, mientras la navegación programática al siguiente paso siga funcionando.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.