feat(autocomplete): allow configuring requireSelection blur behavior without resetting value to null
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### Feature Description
Please add a configurable option such as preserving the previous selection on blur, so that `requireSelection` does not have to emit `null` unless the application explicitly wants that behavior.
Related issues:
- #27767: `requireSelection` clears input on blur
- #28590: `[requireSelection]="true"` breaks `valueChanges`
### Use Case
In our case, we manually restore the previous selected value when Angular resets the control to `null`.
That workaround causes multiple `valueChanges` emissions for a single user interaction: first `null`, then the previously selected value after we restore it. This is noisy, annoying to handle, and not reliably distinguishable from a real clear action triggered by the user.
We want to detect an actual clear action separately from the case where the user only focuses the input, opens the autocomplete panel, and then blurs without selecting a new option. A configurable behavior here would prevent unnecessary state changes and extra reactive form events.
コントリビューションガイド
調査の方向性
Start by tracing the Angular autocomplete requireSelection blur behavior and how it emits valueChanges when the panel closes. Read related issues #27767 and #28590 for existing constraints. Done means applications can configure whether blur preserves the previous selection or emits null, while an explicit clear remains distinguishable.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100