Dialog Component and Structure Field Problem

,

I’m using dialog component and there is structure field in it

my problem is when I remove an item in the structure field the dialog closed and my changes gone before I save it.

ezgif-1ba08d2d0d8096

here is the PHP code
plugins/my-plugin/dialogs/product-update.php:

<?php

use Kirby\X\Product;

return [
    'pattern' => 'master-data/products/(:any)/update',
    'load' => function (string $id) {
        return [
            'component' => 'k-form-dialog',
            'props' => [
                'fields' => require __DIR__ . '/product-fields.php',
                'value' => Product::content($id),
                'size' => 'large',
                'cancelButton' => 'Batal',
                'submitButton' => 'Simpan',
            ],
        ];
    },
    'submit' => function (string $id) {
        return Product::update($id, get());
    },
];
1 Like

That’s unfortunately a limitation of our dialog system. But your dialog is so big that I would switch to a drawer instead anyway. I think it will match a lot better and the structure field also works in drawers.

2 Likes

Ok I will try using drawer component.

thanks for the reply sir.