Required prop example value not restored when unchecking "Allow multiple values"
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3582601. -->
Reported by: [kunal.sachdev](https://www.drupal.org/user/3685163)
Related to !836
>>>
<h3 id="overview">Overview</h3>
<p>When a prop is marked as required and then converted to allow multiple values by checking the "Allow multiple values" checkbox, the example value is cleared (changed to an empty array), this is going to be handled in <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3576124" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3576124</a></span>. However, when unchecking the "Allow multiple values" checkbox to convert back to a single value prop, the default example value that is normally enforced for required props is not restored. Instead, the example value remains empty, which is inconsistent with the expected behaviour for required props.</p>
<h3 id="proposed-resolution">Steps to reproduce</h3>
<ol>
<li>Navigate to a Code Component editor</li>
<li>Add a new prop</li>
<li>Make the prop required.
<ul>
<li>Expected result: The example value is automatically filled with a default value (e.g., "Example text" for Text type)</li>
</ul>
</li>
<li>Check the "Allow multiple values" checkbox</li>
<li>Uncheck the "Allow multiple values" checkbox
<ul>
<li>Actual result: The example value is empty ('')</li>
<li>Expected result: The example value should be restored to the default value that was present in step 3 </li>
</ul>
</li>
</ol>
<h3 id="ui-changes">User interface changes</h3>
issue