Skip to content

AutoComplete: Shift+Home always selects entire text, not from current caret position #8201

@Gerard-CK

Description

@Gerard-CK

Describe the bug

When using the PrimeVue AutoComplete component, pressing Shift+Home in the input field selects the entire text, even if the caret is mid-string. This does not match standard browser input behavior, where Shift+Home should only select from the caret position to the start of the input.

This also occurs on the official PrimeVue demo site with no custom code.

No custom wrappers or event listeners involved; appears as a core component behavior.

This may be due to programmatic selection handling in the component.

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/primevue-4-vite-issue-template-btzd5msn?file=src%2FApp.vue

Environment

Windows 10

Vue version

3.5.21

PrimeVue version

4.4.1

Node version

22.12.0

Browser(s)

No response

Steps to reproduce the behavior

Type any text (e.g., "Apple") in the AutoComplete input.

Click to place the caret in the middle of the text (e.g., between 'p' and 'l').

Press Shift+Home.

The entire input text will be selected—not just from the caret to the start.

Expected behavior

Only the portion of the text between the current caret position and the start of the input should be selected, as in a native input field.

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