mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Fix page height on mobile.
Fix keyboard focus on mobile.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import TextArea, { DEFAULT_LINE_HEIGHT, DEFAULT_TEXT_AREA_PADDING, TextAreaProps, TEXT_AREA_BORDER_WIDTH } from "../components/ui/TextArea";
|
||||
import { useEffect, useRef } from "preact/hooks";
|
||||
import { internalSubscribe } from "./eventEmitter";
|
||||
import { isTouchscreenDevice } from "./isTouchscreenDevice";
|
||||
import TextArea, { DEFAULT_LINE_HEIGHT, DEFAULT_TEXT_AREA_PADDING, TextAreaProps, TEXT_AREA_BORDER_WIDTH } from "../components/ui/TextArea";
|
||||
|
||||
type TextAreaAutoSizeProps = Omit<JSX.HTMLAttributes<HTMLTextAreaElement>, 'style' | 'value'> & TextAreaProps & {
|
||||
forceFocus?: boolean
|
||||
@@ -33,6 +34,7 @@ export default function TextAreaAutoSize(props: TextAreaAutoSizeProps) {
|
||||
ref.current.focus();
|
||||
}
|
||||
|
||||
if (isTouchscreenDevice) return;
|
||||
if (autoFocus && !inputSelected()) {
|
||||
ref.current.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user