Skip to content

[MultiSelect] Component state does not reflect model value after using array push #8153

@FeBe95

Description

@FeBe95

Describe the bug

When updating the model value of a MultiSelect component using modelValue.push(newItemId) the component does not change.

Pull Request Link

#8154

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/2wqklk72?file=src%2FApp.vue

Environment

Windows 11

Vue version

3.5.21

PrimeVue version

4.3.9

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  • Push a new selected item to the model value (e.g. when mounted)
  • MultiSelect component doesn't change

Expected behavior

  • The item in the MultiSelect is being selected programmatically

Example

mounted() {
  this.selectedCitiesOne = ['NY'];
  this.selectedCitiesTwo.push('NY');
},
Image

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