[MGNLUI-6218] defaultValue is not applied within a multi value field Created: 17/Sep/20  Updated: 29/Oct/20  Resolved: 27/Oct/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.4

Type: Bug Priority: Neutral
Reporter: Carlos Cantalapiedra Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
supersession
is superseded by MGNLUI-5852 Streamline default value configuratio... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Epic Link: UI framework implementation
Sprint: UI FW 13, UI FW 14
Story Points: 2

 Description   

Property defaultValue is never applied for fields within a multi value field

Steps to reproduce:
Create a dialog which has a multi value field and within another field, e.g, a textField with a defaultValue. When the dialog opens, the defaultValue is never applied

form:
  properties:
    multi:
      label: Addresses
      i18n: true
      $type: jcrMultiField
      itemProvider:
         $type: currentItemProvider
      field:
        label: ZIP
        $type: textField
        defaultValue: 41010

Actual result:
defaultValue is never applied
Expected result:
After opening the dialog, the defaultValue is written as value at the field
Dev notes:
Using the old UI, it works perfectly even with nested compositeFields within the multi value field:

form:
  tabs:
    - name: tabMain
      label: Categories
      fields:
        - name: selectCategories
          fieldType: multiValue
          label: Select category
          field:
             name: title
             fieldType: composite
             label: Event
             fields:
               - name: title
                 fieldType: text
                 label: Title
                 defaultValue: 0.5
               - name: composite
                 fieldType: composite
                 label: whatever
                 fields:
                   - name: second
                     fieldType: text
                     label: Title
                     defaultValue: 0.5

Using placeholder instead of defaultValue works


Generated at Mon Feb 12 09:34:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.