vaadin / vaadin/framework

A way to handle enter presses in fields needed

Open
#1,457 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.8k
Forks
717
Avg merge
2d 6h
Merged PRs (30d)
3

Description

Originally by @Artur-


A typical use case that is now (often in a bad way) solved using ShortcutListener is to catch enter presses in a field. The problem with ShortcutListener is that it binds to the nearest Panel/Window and thus affects more fields than the requested.

Cases that immediately comes to mind:

  • Login form, enter in username focuses password, enter in password logs in (unless username is empty in which case it focuses username)
  • Any field you want to work consistently in all browsers until #6162 is fixed

Imported from https://dev.vaadin.com/ issue #6454

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ShortcutListener and the Panel/Window event-handling paths mentioned in the issue, then review the related behavior in #6162. The work is done when Enter can be handled by the intended field without affecting unrelated fields, including the login-form cases described.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.