JavaScript prevent (mobile) keyboard to hide

Viewed 25

I have this HTML which has editor and buttons above the keyboard:

------------
|1| Hello  |
|2| World  |
| |        |
| |        |
------------
|Tab|( ) [ |
------------
|qwertyuiop|
| asdfghkl |
| zxcvbnm  |
| [     ]  |
------------

My keyboard is showed when I clicked the editor. If I click the button Tab while the keyboard is shown, the keyboard is hiding. I want to prevent the keyboard from hiding.

Like

keyboard.preventDefault();
1 Answers

You can use JavaScript to focus the input when you click the button

// Add the element selectors here

tabButton.addEventListener('click', () => inputElement.focus());
Related