feat(reply modal): add autofocus on mobile

This commit is contained in:
Tom (plebeius.eth)
2024-09-20 15:38:16 +02:00
parent f247f0e995
commit c58a6bceec
+2 -2
View File
@@ -132,14 +132,14 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s
: `The subplebbit might be offline and publishing might fail.`; : `The subplebbit might be offline and publishing might fail.`;
useEffect(() => { useEffect(() => {
if (showReplyModal && !isMobile) { if (showReplyModal) {
setTimeout(() => { setTimeout(() => {
if (textRef.current) { if (textRef.current) {
textRef.current.focus(); textRef.current.focus();
} }
}, 0); }, 0);
} }
}, [showReplyModal, isMobile]); }, [showReplyModal]);
useEffect(() => { useEffect(() => {
if (textRef.current) { if (textRef.current) {