From c9512b57d283163f930eea1e09a36637b96a93d0 Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Sat, 6 Feb 2021 10:41:06 +0100 Subject: [PATCH] Fix display of inference tree after reload --- src/main/java/edu/kit/typicalc/view/main/InputBar.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/edu/kit/typicalc/view/main/InputBar.java b/src/main/java/edu/kit/typicalc/view/main/InputBar.java index c7757dd..a1afcda 100644 --- a/src/main/java/edu/kit/typicalc/view/main/InputBar.java +++ b/src/main/java/edu/kit/typicalc/view/main/InputBar.java @@ -1,6 +1,7 @@ package edu.kit.typicalc.view.main; import com.vaadin.flow.component.Key; +import com.vaadin.flow.component.UI; import com.vaadin.flow.component.button.Button; import com.vaadin.flow.component.button.ButtonVariant; import com.vaadin.flow.component.dependency.CssImport; @@ -81,7 +82,10 @@ public class InputBar extends HorizontalLayout implements LocaleChangeObserver { */ protected void inferTerm(String term) { inputField.setValue(term); - inferTypeButton.click(); + // for some reason the Vaadin "click" does not work + //inferTypeButton.click(); + UI.getCurrent().getPage().executeJs( + String.format("document.getElementById('%s').click()", INFER_BUTTON_ID)); } private void onInputFieldValueChange() {