Skip to content

AutoComplete with "multiple" broken when adding new items via shift + arrow keys #8109

@NullUserException

Description

@NullUserException

Describe the bug

AutoComplete with multiple (and typeahead at its default/true) doesn't work correctly when you select items, and then try to use shift + arrow keys to select additional items

<AutoComplete
      v-model="value"
      multiple
      ...
    />

Pull Request Link

#8110

Reproducer

https://stackblitz.com/edit/primevue-4-autocomplete-multiple?file=src%2FApp.vue

Environment

Windows 11

Vue version

3.4.31

PrimeVue version

4.3.1

Browser(s)

Firefox 142.0.1 and Chrome 140.0.7339

Steps to reproduce the behavior

Case 1

  1. Enter 'a' and select one option (eg: 'a-0')
  2. Enter 'a' again, and try to use shift+arrow keys to select multiple options

The component will select at most two new options, and discard 'a-0' from the selection

Case 2:

  1. Enter 'a' and select one or more options (eg: 'a-0')
  2. Enter 'b' and try to use shift+arrow keys to select multiple options

The component will discard the previously selected a-* options and only include b-* in the selection

Expected behavior

Cases 1 and 2

The component should allow me to select additional options and still remember my original selection

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions