tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
autoFocus reply box when opened
awarm.space
6 months ago
66465b99
f77e5f04
+7
2 changed files
expand all
collapse all
unified
split
app
lish
[did]
[publication]
[rkey]
Interactions
Comments
CommentBox.tsx
index.tsx
+6
app/lish/[did]/[publication]/[rkey]/Interactions/Comments/CommentBox.tsx
···
40
40
doc_uri: string;
41
41
replyTo?: string;
42
42
onSubmit?: () => void;
43
43
+
autoFocus?: boolean;
43
44
}) {
44
45
let mountRef = useRef<HTMLPreElement | null>(null);
45
46
let quote = useInteractionState((s) => s.commentBox.quote);
···
145
146
},
146
147
},
147
148
);
149
149
+
150
150
+
if (props.autoFocus) {
151
151
+
view.current.focus();
152
152
+
}
153
153
+
148
154
return () => {
149
155
view.current?.destroy();
150
156
view.current = null;
+1
app/lish/[did]/[publication]/[rkey]/Interactions/Comments/index.tsx
···
191
191
<CommentBox
192
192
doc_uri={props.document}
193
193
replyTo={props.comment_uri}
194
194
+
autoFocus={true}
194
195
onSubmit={() => {
195
196
setReplyBoxOpen(false);
196
197
}}