[Drafts] Some bugs (#9833)

* Fix text input not updating

* Fix autofocus

* make placeholder text fainter

* Await invalidation

* Image only drafts

* tweaks to gif presentation

---------

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
Samuel Newman
2026-02-07 17:38:48 +02:00
committed by GitHub
parent 6bfe758d2a
commit 917f099e26
7 changed files with 61 additions and 56 deletions
@@ -52,6 +52,7 @@ export function TextInput({
onPressPublish,
onNewLink,
onFocus,
autoFocus,
}: TextInputProps) {
const {theme: t, fonts} = useAlf()
const autocomplete = useActorAutocompleteFn()
@@ -244,20 +245,10 @@ export function TextInput({
content: generateJSON(richTextToHTML(richtext), extensions, {
preserveWhitespace: 'full',
}),
autofocus: 'end',
autofocus: autoFocus ? 'end' : null,
editable: true,
injectCSS: true,
shouldRerenderOnTransaction: false,
onCreate({editor: editorProp}) {
// HACK
// the 'enter' animation sometimes causes autofocus to fail
// (see Composer.web.tsx in shell)
// so we wait 200ms (the anim is 150ms) and then focus manually
// -prf
setTimeout(() => {
editorProp.chain().focus('end').run()
}, 200)
},
onUpdate({editor: editorProp}) {
const json = editorProp.getJSON()
const newText = editorJsonToText(json)