Skip to content

fix(select): add Enter keypress to dismiss #30622

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haryopba
Copy link

Issue number: resolves #30561


What is the current behavior?

Pressing Enter does not dismiss modal or popover in select-modal or select-popover

What is the new behavior?

  • Pressing Enter dismisses modal or popover in select-modal or select-popover

Does this introduce a breaking change?

  • Yes
  • No

Other information

N/A

@haryopba haryopba requested a review from a team as a code owner August 11, 2025 06:36
@haryopba haryopba requested a review from brandyscarney August 11, 2025 06:36
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 6:38am

Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix and tests! It looks like this doesn't work to select the value using Enter and there is also an issue where the modal immediately closes when you use Enter to open it after selecting something:

modal.mov

This also happens on the Popover example.

I think we need to add something like this to onKeyDown in radio-group to capture the value:

// Handle Enter key for select interfaces
if (['Enter'].includes(ev.key) && inSelectInterface) {
  const previousValue = this.value;
  this.value = current.value;
  if (previousValue !== this.value) {
    this.emitValueChange(ev);
  }
  ev.preventDefault();
}

But I'm not sure how to fix the other problem right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Select-Popover does not select the element when enter is pressed
2 participants