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

Text editor focus problem #6

Open
alidogu opened this issue Mar 10, 2019 · 0 comments
Open

Text editor focus problem #6

alidogu opened this issue Mar 10, 2019 · 0 comments

Comments

@alidogu
Copy link

alidogu commented Mar 10, 2019

Hi, I've solved the focus issue in text editing, do you have a different suggestion?

this.init = function() {
              input = document.createElement("input");
              input.type = "text";
              input.tabIndex = -1;
              input.className = "editor-text";
              args.container.appendChild(input);
              input.addEventListener("keydown.nav", function(e) {
                if (e.keyCode === keyCode.LEFT || e.keyCode === keyCode.RIGHT) {
                  e.stopImmediatePropagation();
                }
              });

              setTimeout(() => {
                input.focus();
                //input.select();
                console.log("init");
              }, 50);
            };
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