EDIT: this feat is impossible. since then I have given up. I shall not delete this question, but rather leave it up right here so future users can see a relevant result to their query on google regarding a similar thing
Goal: Either make a
textarea
bring up the virtual keyboard when focused(with js) OR make ainput[type=text]
have multiple lines AND bring the virtual keyboard (I believe answered here but with unsatisfactory results.) (If anyone knows of fully compatible ways to multiple-line-ify aninput[type=text]
please tell me)Expected results: virtual keyboard popup when focusing the input OR textarea fields (via javascript with no user trigger).
Real results: caret appears in text field but keyboard remains unseen.
Here's what I'm trying on a textarea:
document.elementFromPoint(document.querySelector("textarea").getBoundingClientRect().x, document.querySelector("textarea").getBoundingClientRect().y).dispatchEvent(click);
- Please don't make irrelevant comments about my code organization
- @WaisKamal can you show me your code since you said it works?
- HTML(no CSS):
<textarea>textarea</textarea>
<input type="text" value="input" />
<script>
//document.elementFromPoint(document.querySelector("textarea").getBoundingClientRect().x, document.querySelector("textarea").getBoundingClientRect().y).dispatchEvent("click");
document.querySelector("input").focus();
document.querySelector("input").click();
</script>