Skip to content

Loading an existing file focusses image description #6843

@juliusknorr

Description

@juliusknorr

Describe the bug
When loading an existing file that contains images the focus jumps to the alt text input

To Reproduce
Steps to reproduce the behavior:

  1. Create a new file with some long text
  2. Add an image after it
  3. Move the cursor to the top
  4. Close and reopen the file

Expected behavior
The cursor is at the beginning

Actual behaviour
The cursor is in the alt text of the image

Additional context

This seems like a side effect of #6609

I'm unsure what the best way would be to catch only inserting new attachments. @max-nextcloud Any idea on how we could check that? I don't see any hooks for tiptap node or node views that would only trigger on first creation. Maybe we can override the setImage command and pass a non-persited flag to focus once?

cc @JuliaKirschenheuter

Metadata

Metadata

Labels

Type

No type

Projects

Status

☑️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions