-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hello!
Great addon and very useful.
Unfortunately the focus gets lost after pressing the "x".
Therefore for example my shortcust listener is not longer called:
public final class TextFieldUtils {
@SuppressWarnings("serial")
public static void handleEnterEvent(TextField searchField, Listener listener) {
ShortcutListener enterShortCut = new ShortcutListener("EnterShortcut", ShortcutAction.KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
listener.handleAction(sender, target);
}
};
handleShortcut(searchField, enterShortCut);
}
private static void handleShortcut(AbstractTextField textField, ShortcutListener shortcutListener) {
textField.addFocusListener((FieldEvents.FocusEvent event) -> textField.addShortcutListener(shortcutListener));
textField.addBlurListener((FieldEvents.BlurEvent event) -> textField.removeShortcutListener(shortcutListener));
}
}
Best Regards,
Thomas
Metadata
Metadata
Assignees
Labels
No labels