I have a simple View with a TextField and a Button
@Route
public class MainView extends VerticalLayout {
public MainView() {
TextField textField = new TextField();
add(textField);
Button button = new Button("Click me");
ShortcutRegistration shortcutRegistration = button.addClickShortcut(Key.F8);
shortcutRegistration.setBrowserDefaultAllowed(false);
shortcutRegistration.setEventPropagationAllowed(true);
button.addClickListener(event -> {
System.out.println("Value: " + textField.getValue());
});
add(button);
}
}
When I click the Button then I get the value of the TextField but when I hit F8 the value is empty.
Is this a bug or am I missing something?