fixed #71 : input autofocus on touch devices

This commit is contained in:
unknown 2021-08-25 13:40:38 +05:30
parent 0bce6c6a46
commit 18bd9d62cb
2 changed files with 3 additions and 0 deletions

View file

@ -134,6 +134,7 @@ function ChannelViewInput({
}
function focusInput() {
if (settings.isTouchScreenDevice) return;
textAreaRef.current.focus();
}

View file

@ -24,6 +24,8 @@ class Settings extends EventEmitter {
this.themeIndex = this.getThemeIndex();
this.isMarkdown = this.getIsMarkdown();
this.isTouchScreenDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0);
}
getThemeIndex() {