-
Notifications
You must be signed in to change notification settings - Fork 541
8245053: Keyboard doesn't show when TextInputControl has focus #219
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
Conversation
|
👋 Welcome back abhinayagarwal! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
out off my home-zone here, just fyi and in case it might be relevant to android skins as well: there's an umbrella issue to cleanup skin implementations JDK-8241364 - both the android text skins look like leaking in the manually registered focus listener (not introduced here) and the eventHandler added here. Probably should be removed manually in dispose (or in the case of the focusListener, registered via skin api). |
|
@kleopatra Done! |
modules/javafx.controls/src/android/java/javafx/scene/control/skin/TextAreaSkinAndroid.java
Show resolved
Hide resolved
|
wondering if there is any way to include android specific skins in unit testing? For all (nearly, htmlEditor excluded ;) others we have a test to guard against contract violations (and will soon have tests for memory leaks). |
|
Indeed. It would be good if we could add a few Android specific tests which are automatically activated when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
A test strategy for Android is a good idea for a follow-up issue.
|
@abhinayagarwal This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type
Since the source branch of this PR was last updated there have been 83 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge As you are not a known OpenJDK Author, an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@johanvos) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
|
Have you considered the case where a TextField is focused by default when its view is shown? As soon as the view is shown the keybord will pop up, even if the user does not plan to edit anything. I just experienced this when I exchanged the Label in the HelloGluon example against a TextField. A lot of strange things then happen. The keyboard pops up, it hides the Gluon nag screen, if you close the keyboard and the nag screen you still see these edit markers and all this just because this text field was focused by default. To my opinion the keyboard and the edit markers should only be shown when the user actually clicks into the text field and thus indicates that he really wants to edit something. I also noticed that after the keyboard was shown I could not normally close the application anymore. (This was on Android with a Galaxy Tab 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth discussing the case were a TextInput is the only control.
|
@mipastgt The issue happens because of the focus listener. With this PR, we introduce We should most probably also introduce an API for showing the keyboard as available on both iOS and Android platforms :) Thoughts? |
|
It is probably good to add this suggestion in this PR. I'll review again once it is in. |
0aa7902 to
44fc875
Compare
…ible for hiding the keyboard only.
44fc875 to
b13c44b
Compare
|
/integrate |
|
@abhinayagarwal |
|
/sponsor |
|
@johanvos @abhinayagarwal The following commits have been pushed to master since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit 5d34d72. |
In Android, TextInputControls (TextField and TextArea) are responsible for showing and hiding software keyboard. Currently, a focus listener is attached to these controls and is used to toggle the visibility of keyboard. This condition fails in cases where the control already has focus but the keyboard is not visible.
Ideally, the keyboard should be shown again when the user taps on the TextInputControl.
This PR adds an event handler for
MouseEvent.MOUSE_CLICKEDevent and shows the keyboard if the TextInput control is both editable and focused.Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jfx pull/219/head:pull/219$ git checkout pull/219