From c58a6bceec0285710e1348f11eadcef98f0e41b8 Mon Sep 17 00:00:00 2001 From: "Tom (plebeius.eth)" Date: Fri, 20 Sep 2024 15:38:16 +0200 Subject: [PATCH] feat(reply modal): add autofocus on mobile --- src/components/reply-modal/reply-modal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index 6884f178..4f039b16 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -132,14 +132,14 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s : `The subplebbit might be offline and publishing might fail.`; useEffect(() => { - if (showReplyModal && !isMobile) { + if (showReplyModal) { setTimeout(() => { if (textRef.current) { textRef.current.focus(); } }, 0); } - }, [showReplyModal, isMobile]); + }, [showReplyModal]); useEffect(() => { if (textRef.current) {