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

HtmlTextInput cannot show SoftKeyboard in safari on iOS9.1(branch zebkit-next-generation) #81

Open
jfojfo opened this issue Dec 15, 2015 · 2 comments

Comments

@jfojfo
Copy link

jfojfo commented Dec 15, 2015

if comment out e.preventDefault() or change it to e.stopPropagation() in PointerEventUnifier, keyborad will show normally.

element.addEventListener("touchstart", function(e){
   ...
   //e.preventDefault();
   e.stopPropagation();
});
element.addEventListener("touchend", function(e){
   ...
   //e.preventDefault();
   e.stopPropagation();
});
element.addEventListener("touchmove", function(e){
   ...
   //e.preventDefault();
   e.stopPropagation();
});

testing code follows:

    eval(zebra.Import("ui", "layout"));

    var root = new zCanvas(400, 400).root;
    root.setPadding(8);
    root.setBorder("plain");
    root.setBackground("#EEEEEE");
    root.setLayout(new BorderLayout(4,4));
    root.add(LEFT, new HtmlTextArea("HTML text area"));
    root.add(TOP, new HtmlTextField("HTML input field"));
    root.add(CENTER, new TextArea("Zebra text area"));
    root.add(BOTTOM, new Button("Test"));
@jfojfo
Copy link
Author

jfojfo commented Dec 15, 2015

only deal with input and textarea

// in PointerEventUnifier:
                element.addEventListener("touchstart", function(e) {
                    ...

                    var tagName = e.target.tagName.toLowerCase();
                    if (tagName !== 'input' && tagName !== 'textarea' || e.target.hasAttribute('readonly')) {
                        e.preventDefault();
                    }

                }, false);

                element.addEventListener("touchend", function(e) {
                    ...

                    var tagName = e.target.tagName.toLowerCase();
                    if (tagName !== 'input' && tagName !== 'textarea' || e.target.hasAttribute('readonly')) {
                        e.preventDefault();
                    }

                }, false);

@jfojfo
Copy link
Author

jfojfo commented Dec 17, 2015

fixed many problems in my branch, see https://github.com/jfojfo/zebra

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