jongacnik / kirby-fields-block

Kirby block preview plugin to directly render block fields
MIT License
109 stars 5 forks source link

Unable to make trailling space in heading block inside of a Layout Block #12

Open jeremypetrequin opened 1 year ago

jeremypetrequin commented 1 year ago

Hello,

Thank a lot for your plugin it save me a lot of time. I've just noticed a strange bug:

name: Colonnes
icon: grid-right
preview: fields
label: false
fields:
  columns:
    label: Colonnes
    type: layout
    layouts:
      - "1/2, 1/2"
    fieldsets:
      - heading
      - markdown
      - image
      - button

https://user-images.githubusercontent.com/911072/196618458-9db13248-4904-4a76-99f7-41faa25c17db.mp4

Looking at your code source, I've could "resolve" the bug by adding a condition to not $emit('update') event if we are in drawer

on: {
      "input": function ($event) {
          if(!document.querySelector('.k-drawer')) {
              _vm.$emit("update", $event)
          }
      }
  }

Yes, it's a pretty ugly hack, I imagine it could be done better and I made it directly in compiled javascript code... 😬, I didn't have too much time to look at it.. But maybe these clues can help you resolve it.

Have a good day, sorry for my english ;)