fixed #71 : input autofocus on touch devices
This commit is contained in:
@@ -134,6 +134,7 @@ function ChannelViewInput({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function focusInput() {
|
function focusInput() {
|
||||||
|
if (settings.isTouchScreenDevice) return;
|
||||||
textAreaRef.current.focus();
|
textAreaRef.current.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ class Settings extends EventEmitter {
|
|||||||
this.themeIndex = this.getThemeIndex();
|
this.themeIndex = this.getThemeIndex();
|
||||||
|
|
||||||
this.isMarkdown = this.getIsMarkdown();
|
this.isMarkdown = this.getIsMarkdown();
|
||||||
|
|
||||||
|
this.isTouchScreenDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
getThemeIndex() {
|
getThemeIndex() {
|
||||||
|
|||||||
Reference in New Issue
Block a user