libgdx / libgdx/libgdx

scene2d.ui.TextField doesn't use 'keyboard' field consistently

Open
#6,944 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
25.4k
Forks
6.5k
Avg merge
1d 16h
Merged PRs (30d)
5

Description

TextField has a 'keyboard' member which it uses to show keyboard (on Android), however in order to hide the keyboard, it uses hardcoded call:
Gdx.input.setOnscreenKeyboardVisible(false);
which makes no sense - either use on or the other. For example, when showing the on-screen keyboard, it uses keyboard.show(true) (line 850), when hidding it however it calls the above line (which 'keyboard' uses as well, but the point of 'keyboard' is to allow user to override it with proper implementation - which makes no sense if TextField is using it only for showing and not also for hiding the keyboard).

So, the line cited above should be changed to keyboard.show(false);.

LibGDX version: all (up to current master, 1.11.0).

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 in scene2d.ui.TextField and compare the keyboard.show(true) call with the hardcoded Gdx.input.setOnscreenKeyboardVisible(false) call described in the issue. Done means the keyboard member handles both showing and hiding, with the existing TextField keyboard behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.