Skip to content
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

non-working input in TextField on Android #1281

Open
grigory-dzh-rpj opened this issue Sep 11, 2024 · 4 comments
Open

non-working input in TextField on Android #1281

grigory-dzh-rpj opened this issue Sep 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@grigory-dzh-rpj
Copy link

grigory-dzh-rpj commented Sep 11, 2024

Expected behavior**

An incomprehensible problem with typing in TextField on android 13

Current behavior**

I am programmatically replacing

public VBox newbox() {
VBox v = new VBox()
TextField tf = new TextField();
v.getchildren.setAll(tf);
}
...

vbox.getChildren.setAll(newbox());

And after replacing the TextField, it does not work correctly, the keyboard appears, but any input leaves the input window empty.
On iOS, the same code works perfectly!

My environment

Build via ubuntu:
-javafx-version 19
-gluon-plugin.version 1.0.23
-charm.version 6.2.3
-gluon-22.1.0.1-Final

document_5408960325137484597.mp4
@grigory-dzh-rpj grigory-dzh-rpj added the bug Something isn't working label Sep 11, 2024
@ctoabidmaqbool
Copy link

Maybe you are using custom keyboard, I think, unfortunatly, it only works with default system installed keyboard!

@grigory-dzh-rpj
Copy link
Author

grigory-dzh-rpj commented Sep 11, 2024

Maybe you are using custom keyboard, I think, unfortunatly, it only works with default system installed keyboard!

no - I use the standard one and it works until I change the children in the main vbox. But running in the test on linux and iPhone everything works fine everywhere

document_5407057010380264569.mp4

@iammmmmmm
Copy link

iammmmmmm commented Sep 12, 2024

I have the same issue, unfortunately, there is no solution yet.Can you provide minimal reproducibility?

@grigory-dzh-rpj
Copy link
Author

grigory-dzh-rpj commented Sep 12, 2024

solution

1)Creating a View controller singleton from FXML
let's say fxml contains a view that has only one VBox

<View fx:id="main" stylesheets="@test.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.dg.views.MainController" >
      <VBox fx:id="centerViewVbox" alignment="CENTER" BorderPane.alignment="CENTER" >
  private static MainController instance;
    public static MainController getInstance() {
        if (instance == null) {
            instance = new MainController();
        }
        return instance;
    }
    public static void setInstance(MainController mainController) {
        instance = mainController;
    }

**2) I initialize my controller at startup **

 public static MainController startMainController;
@Override
    public void start(Stage primaryStage) throws Exception {
        appManager.start(primaryStage);
        startMainController = MainController.getInstance();
    }

3) Create Vbox c TextFileds

 public VBox vboxWithTextField(){
          VBox vbox = new VBox(new TextField());
          return vbox;
 }

4) Now when I take and change the children from my VBox from startMainController, the input to TextField will no longer work on Android
startMainController.centerViewVbox.getChildren.setAll(vboxWithTextField());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants