Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/routes/users+/$username_+/__note-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export function NoteEditor({
<Label>Images</Label>
<ul className="flex flex-col gap-4">
{imageList.map((imageMeta, index) => {
const image = note?.images[index]
const imageMetaId = imageMeta.getFieldset().id.value
const image = note?.images.find(
({ id }) => id === imageMetaId,
)
return (
<li
key={imageMeta.key}
Expand Down Expand Up @@ -225,7 +228,10 @@ function ImageChooser({
</div>
)}
{existingImage ? (
<input {...getInputProps(fields.id, { type: 'hidden' })} />
<input
{...getInputProps(fields.id, { type: 'hidden' })}
key={fields.id.key}
/>
) : null}
<input
aria-label="Image"
Expand All @@ -245,6 +251,7 @@ function ImageChooser({
}}
accept="image/*"
{...getInputProps(fields.file, { type: 'file' })}
key={fields.file.key}
/>
</label>
</div>
Expand All @@ -257,6 +264,7 @@ function ImageChooser({
<Textarea
onChange={(e) => setAltText(e.currentTarget.value)}
{...getTextareaProps(fields.altText)}
key={fields.altText.key}
/>
<div className="min-h-[32px] px-4 pt-1 pb-3">
<ErrorList
Expand Down