lazy-blocks
lazy-blocks copied to clipboard
Initial rendered value with repeater
Insertion of repeater row does not pass to server render initialy selected value of select box
dump of xhr request event (to /wp-json/lazy-blocks/v1/block-render) shows that 3rd row content is empty
Unfortunately, default values of repeater items are not supported at all.
Not sure if it is about default value. I'm not using it.
It's about first value. My select contains some items so when i'm inserting row it inserts select with the first value selected automaticaly. It's not null, not empty and it's not default.
It's just first value in pre-defined select block and it pass to server as empty.
You added options to select field, but it doesn't mean, that it has a default value by default. It just displayed the first available option in the select field, nothing special.
I recommend you enable this setting for now:
It will add this new option:
But I see another bug :) It will save the value '-- Select --' when you manually select this first value... It will be fixed soon :)
Hi guys!
I have a mandatory select field where I want to require the user to select one of the values, but I can't do it, if I use a field with Allow null, then the field can be left at Select and it will be valid, which is wrong for me, if I use a field without Allow null, then the field will automatically set the first value from the list to label, in the second case is fun - if I need the first value and it is visible that it is set to field, then it is still not valid until I manually expand the list and select it
I think this problem could be solved by default field support, which unfortunately is not supported yet :(
Thanks for the lazy blocks! :rocket:
https://user-images.githubusercontent.com/17677196/141504862-03f98a5e-c460-470c-92c9-33b289b08152.mp4
In the v3 we added support for default control values inside the repeater. Defaults are inserted automatically once you add the row.