Skip to content

Conversation

@iamgerwin
Copy link
Owner

Summary

  • Fixed child field values not being saved when NovaDependencyContainer is used inside nova-flexible-content layouts
  • Child fields now correctly receive the Flexible prefix for proper form data submission

Problem

When NovaDependencyContainer was used inside a nova-flexible-content Flexible field:

  1. The dependency visibility worked correctly (fields showed/hid based on conditions)
  2. BUT the child field values were NOT being saved on form submission
  3. This happened because Flexible generates cryptic prefixes (e.g., cDsaj6Ub0m9hChBj__) for field attributes
  4. NovaDependencyContainer's child fields were using unprefixed attributes like recipient_email
  5. But Flexible expected cDsaj6Ub0m9hChBj__recipient_email in the form data

Solution

Added applyFlexiblePrefixToChildFields() method that:

  1. Detects the Flexible context prefix at mount time
  2. Applies the prefix to all child field attributes
  3. Ensures form data includes the correct prefixed keys

Changes

  • resources/js/components/FormField.vue: Added applyFlexiblePrefixToChildFields() method
  • dist/js/field.js: Rebuilt production assets
  • CHANGELOG.md: Added v1.0.15 release notes

Related

Test Plan

  • Verify dependent fields show/hide correctly inside Flexible layouts
  • Verify dependent field values are saved when form is submitted
  • Verify console logs show prefixed attributes being applied
  • Build production assets with no errors

…submission

- Add applyFlexiblePrefixToChildFields() to prefix child field attributes
- Child fields inside Flexible layouts now use correct prefixed attributes
- Form data now properly includes prefixed keys like cDsaj6Ub0m9hChBj__recipient_email
- Fixes field values not being saved in nova-flexible-content contexts

Related: whitecube/nova-flexible-content#524
@iamgerwin iamgerwin merged commit ac6b442 into main Nov 25, 2025
0 of 2 checks passed
@iamgerwin iamgerwin deleted the fix/issue-4-flexible-field-save-and-display branch November 25, 2025 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants