mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(reply modal): add autofocus on mobile
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user