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.
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());
},
];