Closed adamkiss closed 1 year ago
Not sure I get your examples. I assume you just write them here in a blueprint notation, because actually you should be passing a PHP array. And for that, yes there likely will differences to the blueprint notations. But I wouldn't consider these a bug but expected behaviour.
@distantnative yes, i just showed the setup as yaml for brevity, otherwise the definition is a PHP array.
Ok, I hope I can explain this in a way that makes sense:
If you pass fields etc to Fiber dialogs, the values you pass are directly the props that the Vue components will receive. Which is different to blueprints that first undergo transformation, logic etc. (most located in config/fields
).
To achieve the same, you would probably first need to create a return new Form(['fields' => ..., 'values' => $..., 'model' => ...]);
. And from that form get the values to pass as raw props to your dialog fields.
That's fair, and looking at <k-select-input>
's code, I can see that it expects Array
for options
, which key: value
pair in Javascript isn't.
Anyway, if this is expected, I'm closing this.
One day I hope we might offer something easier like (new Blueprint(...))->fields()->props()
Description
When using
radio
field in a custom dialog, options invalue: text
format[1] are not loaded. If these options are expanded to the format defining "value" and "text" separately[2], default option is ignored if the field's value in thevalue
props isn't defined.[1] simple format:
[2] alternative format:
Expected behavior
dialog.props.value.[field-name]
isn't defined, default value is correctly selectedScreenshots
To reproduce
site:page.changeStatus
)Your setup
Kirby Version
3.8.3