added shortcut to reply
This commit is contained in:
parent
e0d1136230
commit
40cb0a0681
4 changed files with 43 additions and 13 deletions
|
@ -198,7 +198,6 @@ const TootComposer: Component<{
|
|||
client?: mastodon.rest.Client;
|
||||
inReplyToId?: string;
|
||||
onSent?: (status: mastodon.v1.Status) => void;
|
||||
inputProps?: JSX.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
||||
}> = (props) => {
|
||||
let inputRef: HTMLTextAreaElement;
|
||||
let sendKey: string | undefined;
|
||||
|
@ -217,6 +216,12 @@ const TootComposer: Component<{
|
|||
setLanguage(lang);
|
||||
});
|
||||
|
||||
createEffect(() => {
|
||||
if (typing()) {
|
||||
setTimeout(() => inputRef.focus(), 0);
|
||||
}
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
makeEventListener(inputRef, "focus", () => setTyping(true));
|
||||
});
|
||||
|
@ -312,7 +317,6 @@ const TootComposer: Component<{
|
|||
}
|
||||
style={{ width: "100%", border: "none" }}
|
||||
disabled={sending()}
|
||||
{...props.inputProps}
|
||||
></textarea>
|
||||
<Show when={props.client}>
|
||||
<Show
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue