Skip to content

AutoComplete component: Selected option is not cleared when forceSelection is set to True #19438

@stymchenko

Description

@stymchenko

Describe the bug

Removing all text from the AutoComplete component's input manually does not trigger the form value to be cleared when the forceSelection option is set to True.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/stackblitz-starters-gzhepj64?file=src%2Fapp.component.ts

Environment

Angular 21.1.0 + Primeng 21.1.1

Angular version

21.1.0

PrimeNG version

v21

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  • Select the country in the AutoComplete
  • Clear the text inside the input
  • Observe that the "Selected value" is still shown

Expected behavior

"Selected value" should be cleared after clearing the input text

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions