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 lost on Android device #14

Closed
chou666 opened this issue Dec 15, 2017 · 2 comments
Closed

Focus lost on Android device #14

chou666 opened this issue Dec 15, 2017 · 2 comments

Comments

@chou666
Copy link

chou666 commented Dec 15, 2017

Hello,

When there is an input in the content, the focus is lost when selecting it: we cannot enter value!

Observed on 2 Android tabs, not on PC or iPad

Sample:

	new $.Zebra_Dialog('Enter your value: <input type="text" maxlength="12"/>', {
	    width: 600,
	    title: 'Focus lost on Android'
	});

Do you observed this issue?

@chou666 chou666 closed this as completed Dec 15, 2017
@chou666 chou666 reopened this Dec 15, 2017
@chou666
Copy link
Author

chou666 commented Dec 15, 2017

Sorry, reopen the issue observed in version 1.3.12, and still present in version 1.4.1.

each time the _draw function is call, the focus is restored to the first button.
The focus must be set only once, no?

@chou666
Copy link
Author

chou666 commented Dec 15, 2017

A solution can be to check if focus is already somewhere in the Zebra dialog.
Something like that:

            if (0 ===  $((null === document.activeElement) ? document : document.activeElement).parents('.ZebraDialog').length) {
                // move the focus to the first of the dialog box's buttons
                plugin.dialog.find('a[class^=ZebraDialog_Button]:first').focus();
            }

Your opinion?

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

1 participant