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

Focus gets lost #12

Open
thomaspp opened this issue Aug 2, 2016 · 4 comments
Open

Focus gets lost #12

thomaspp opened this issue Aug 2, 2016 · 4 comments

Comments

@thomaspp
Copy link

thomaspp commented Aug 2, 2016

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

@tapioaali
Copy link
Owner

What browser are you using? At least with Chrome on OSX the focus returns to the textfield properly after pressing X.

@thomaspp
Copy link
Author

thomaspp commented Aug 8, 2016

Hello,

I use FireFox on Windows. The problem is not, that the focus is returned to the text field. The only issue is that the events are not fired (see code example).

Best Regards,
Thomas

@thomaspp
Copy link
Author

Hello,

do you have any idea how to solve this issue?

Regards,
Thomas

@denniegrondelaers
Copy link

No news here?

I'm currently using OSX and Chrome and the focus sort of works, but my focus listener doesn't get triggered.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants