getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.32k stars 168 forks source link

Structure field in structure field: bug content not saved #4147

Closed andreasotto closed 2 years ago

andreasotto commented 2 years ago

Description

When a structure field is placed in a structure field, the content is not saved in some cases. This always happens when the modified field is not exited, but saved with Cmd-S. Obviously the dirty flag is set only when leaving the field or something similar. In any case, this leads to the fact that the content of the field is not saved after changing and saving via keyboard shortcut.

Unfortunately, all changes that were made before are lost.

Expected behavior
Entered text should be saved when hitting Cmd-S.

To reproduce

Create a blueprint with a field like this:

  blocks:
    type: structure
    fields:
      headline:
        type: text
        label: Überschrift
      paragraphs:
        type: structure
        label: Absätze
        fields:
          text:
            type: writer
          link:
            type: pages
            multiple: false
  1. Then open the panel and insert some initial content.
  2. Save the content.
  3. Edit the content in the field text and hit Cmd-S to save => now the content is lost.

If you use your mouse to save, everything works. If you leave the current form field and then save, everything works. If you don't leave the field but hit Cmd-S, the content is lost.

Kirby Version
3.6.2

afbora commented 2 years ago

Actually I can't reproduce the issue. Also seems this issue same with https://github.com/getkirby/kirby/issues/2550. Which browser (and version) do you use?

andreasotto commented 2 years ago

Current chrome, current Safari. Kirby version 3.6.1.1 and 3.6.2 tested. For me it's easy to reproduce. Should i try to describe again? It seems that the form doesn't recognize it's dirty and has to save something. When pressing Cmd-S it just leaves the form but without saving.

afbora commented 2 years ago

@andreasotto Here my screencast, are my steps right?

https://user-images.githubusercontent.com/3393422/154437638-3b9c81ed-cb63-44f4-a264-c25ed75b3168.mp4

afbora commented 2 years ago

When the issue recurs, we'll reopen it and take a closer look. I'm closing for now.