mirror of
https://github.com/zoldar/jenot.git
synced 2026-01-03 14:32:54 +00:00
Hide onscreen keyboard by defocusing input on touch move
This commit is contained in:
parent
d880130303
commit
03c1bc9931
1 changed files with 12 additions and 0 deletions
|
|
@ -118,6 +118,18 @@ class EditableArea extends HTMLElement {
|
|||
this.#sync();
|
||||
});
|
||||
|
||||
const onTouchMove = () => {
|
||||
this.inputElement.blur();
|
||||
};
|
||||
|
||||
this.inputElement.addEventListener("focus", () => {
|
||||
document.addEventListener("touchmove", onTouchMove);
|
||||
});
|
||||
|
||||
this.inputElement.addEventListener("blur", () => {
|
||||
document.removeEventLitener("touchmove", onTouchMove);
|
||||
});
|
||||
|
||||
new ResizeObserver(() => {
|
||||
this.inputElement.style.height = this.displayElement.scrollHeight + "px";
|
||||
this.inputElement.style.width = this.displayElement.scrollWidth + "px";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue