default value on dynamically added form fields
And one of component classes have:
Some default text is not appearing.. Anyone know why? Thanks
4 Replies
You can't set a default field on dynamics since defaults are populated once the dom has loaded and not again.
You would need to use $set() to set defaults post load. maybe with a $get to check it is empty.
i've found an ugly workaround, but thanks 😄
@SOIX can you share you solution please? A face the same issue
Well I predefined hidden fields for default values and then populated dynamic element like this:
So basically populate dynamic form with
mountUsing
. Now I guess i needed to hnave predefined keys in form, so thats why i haave hidden fields, but if u can find other way you can remove it.