Closed vocabulary fields give no feedback when free text is typed and not selected
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- angular, typescript
- Área
- frontend
Línea de trabajo
Empieza con dynamic-onebox.component.ts, especialmente con DsDynamicOneboxComponent.onBlur(), y sigue cómo su evento blur llega a ds-dynamic-form-control-container y al estado del FormControl. Reproduce el caso descrito con un campo onebox obligatorio de vocabulario cerrado y texto que no coincide. Se considera terminado cuando, al salir del campo, se muestra una indicación visible de que el valor no es válido y el texto rechazado deja de mostrarse, sin cambiar el comportamiento de las sugerencias coincidentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On a submission form field that uses a closed vocabulary (<vocabulary closed="true">) with the onebox input type, typing text without picking a suggestion gives the user no feedback at all. The typed text is never written to the FormControl, which is correct for a closed vocabulary, but nothing marks the field as invalid or touched either, so no error message and no invalid styling appears. If the field is also required, the user only finds out the value was rejected when they try to deposit.
Two things in DsDynamicOneboxComponent.onBlur() contribute:
- when the typeahead suggestion list is open, the method calls
event.preventDefault()andevent.stopImmediatePropagation()and returns withoutthis.blur.emit(event). The error message under the field is drawn byds-dynamic-form-control-container, which only clears its focus state when a blur event reaches it, so the message stays hidden. - nothing ever calls
markAsTouched()or sets an error on the control for the closed vocabulary case, so even after the field is left there is no invalid state to render.
I ran into this on DSpace-CRIS 2025.02, but onBlur in dynamic-onebox.component.ts is identical on main and dspace-9_x, and markAsTouched does not appear in that file on either branch, so it should apply there too. Browser was Chrome.
To Reproduce
- Configure a submission form field with
input-typeonebox, a<required>message, and<vocabulary closed="true"> - Start a submission and type some text into that field that does not match any vocabulary entry
- Wait for the suggestion list to appear, then click somewhere else on the form while it is still open
- The field shows no error message and no invalid styling. The typed text also stays in the box even though nothing was stored.
Expected behavior
Leaving a closed vocabulary field with text that was never matched to an entry should mark the field invalid and show the required error message, the same way any other required field does when it is left empty. The box should not keep showing text that was not stored.
Related work
Related to #4501 and #4502, but not the same path. Those cover the hierarchical vocabulary tree modal. This one is the typeahead suggestion list on a flat closed vocabulary, and #4502 does not add any control state handling.
We have a fix running locally against 2025.02 that flags the control and emits the blur only when a closed vocabulary violation was actually detected. Happy to open a PR against main if that direction is wanted.
- Lenguaje dominante
- TypeScript
- Estrellas
- 180
- Forks
- 577
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 111
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DSpace/dspace-angular
-
affects: 10.x affects: 9.x bug component: submission Difficulty: Low help wanted ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
DSpace/dspace-angular#6412 ·
Los mantenedores suelen responder en 3 días
-
accessibility affects: 10.x affects: 8.x affects: 9.x bug help wanted ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DSpace/dspace-angular#6364 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Author browse links on item page open in a new tab, unlike other browse linksPosiblemente ocupada @jesielviana la tomó hace 18 días. Abiertoaffects: main bug component: Item low priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DSpace/dspace-angular#6268 · 4 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
Mathjax single dollar sign delimiter configuration causes unintentional math rendering in abstractsAbiertobug needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
DSpace/dspace-angular#6263 ·
Los mantenedores suelen responder en 3 días
-
UI spacing regression on ds-generic-item-page-field (extra spaces around metadata values) in v10.xAbiertoaffects: 10.x affects: main bug component: Item ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DSpace/dspace-angular#6254 · 1 comentario ·
Los mantenedores suelen responder en 3 días
Todos los issues de DSpace/dspace-angular
Issues similares
-
New icon: `filter-clear`Abiertocalcite-ui-icons enhancement impact - p3 - not time sensitive needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Esri/calcite-design-system#15467 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
diegosouzapw/OmniRoute#18390 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
guilhermerodz/input-otp#157 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
davidjerleke/embla-carousel#1414 ·
Los mantenedores suelen responder en 4 días