w3c / w3c/editing

Detecting if a virtual keyboard will open if an element gets focus

Open
#402 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
202
Forks
43
PR merge metrics
No merged PRs in 30d

Description

In our chat application, we often move focus back to the message field after an action such as deleting a message has been performed. Unfortunately, this opens up the virtual keyboard in many cases, so we disable this behavior if we think we're on a mobile device. We currently check this using screen size, but that's not a great heuristic.

It would be great if there were a way to check if moving focus to an input or contentEditable element would cause an on-screen keyboard to open. We might be able to solve this with the inputPanelPolicy proposed in #225, but that would mean blocking the keyboard by default, and then re-enabling it in the cases when we want it to appear, and I'd prefer to do it the other way around.

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 the issue and the referenced inputPanelPolicy proposal in #225. Clarify whether the desired outcome is a new way to detect keyboard opening or a different focus policy, then document an agreed specification direction; no file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.