Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoComplete: Space key prevents typing spaces in input field #7294

Open
MildConcussion opened this issue Feb 21, 2025 · 2 comments
Open

AutoComplete: Space key prevents typing spaces in input field #7294

MildConcussion opened this issue Feb 21, 2025 · 2 comments

Comments

@MildConcussion
Copy link

MildConcussion commented Feb 21, 2025

Bug Description

The Space key is currently mapped to trigger onEnterKey in the AutoComplete component, preventing users from typing spaces in the input field.

Current Behavior

  • Pressing Space triggers selection behavior (onEnterKey)
  • Unable to type spaces in the AutoComplete input field

Expected Behavior

  • Space key should allow typing spaces in the input field
  • Only Shift+Space should trigger selection behavior (for range selection)

Related Commit

This was introduced in PR: #7082

Steps to Reproduce

  1. Use an AutoComplete component
  2. Try to type a sentence with spaces
  3. Observe that spaces cannot be typed

Environment

  • PrimeVue version: 4.3.0-rc.1
  • Browser: Chromium, MacOS
@MildConcussion
Copy link
Author

@J-Michalek Could you take a look please? It doesn't seem like intended behavior.

Perhaps something like

case 'Space':
    if (event.shiftKey) {
        this.onEnterKey(event);
    }
    break;

or

onSpaceKey(event) {
    if (this.focusedOptionIndex !== -1) {
        this.onEnterKey(event);
    }
},

@J-Michalek
Copy link
Contributor

@MildConcussion Hello, thanks for looking into this, definitely not intended.

I will try to have a look next week.

Perhaps you could take a look into this and submit a PR if you feel like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants