Closed vocabulary fields give no feedback when free text is typed and not selected
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- angular, typescript
- 領域
- frontend
調査の方向性
dynamic-onebox.component.ts、特に DsDynamicOneboxComponent.onBlur()から始め、blurイベントがどのように ds-dynamic-form-control-container とFormControlの状態に伝わるかを追ってください。必須の閉じた語彙を持つoneboxフィールドに一致しないテキストを入力する、説明されているケースを再現してください。フィールドを離れたときに無効であることが視覚的に示され、拒否されたテキストが表示されなくなり、一致する候補に対する動作は変わらなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 180
- フォーク
- 577
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 111
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DSpace/dspace-angular のほかの issue
-
affects: 10.x affects: 9.x bug component: submission Difficulty: Low help wanted ux
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
DSpace/dspace-angular#6412 ·
メンテナーはふだん 3 日以内に返信
-
accessibility affects: 10.x affects: 8.x affects: 9.x bug help wanted ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DSpace/dspace-angular#6364 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Author browse links on item page open in a new tab, unlike other browse links対応中かも @jesielviana が 19 日前に担当しました。 オープンaffects: main bug component: Item low priority
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DSpace/dspace-angular#6268 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
Mathjax single dollar sign delimiter configuration causes unintentional math rendering in abstractsオープンbug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DSpace/dspace-angular#6263 ·
メンテナーはふだん 3 日以内に返信
-
UI spacing regression on ds-generic-item-page-field (extra spaces around metadata values) in v10.xオープンaffects: 10.x affects: main bug component: Item ux
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DSpace/dspace-angular#6254 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
DSpace/dspace-angular の issue をすべて見る
似ている issue
-
[Bug]: Pen taps on sidebar rows start a drag and lose their click対応中かも @makhnatkin が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
b310-digital/teammapper#1515 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
puckeditor/puck#1884 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
outline/outline#14378 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nicobailon/pi-web-access#642 ·
メンテナーはふだん 1 日以内に返信