Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms can't display nested validation errors #490

Open
thecyrilcril opened this issue Jul 31, 2023 · 0 comments
Open

Forms can't display nested validation errors #490

thecyrilcril opened this issue Jul 31, 2023 · 0 comments

Comments

@thecyrilcril
Copy link

  • Laravel Version: 10.16.1
  • PHP Version: 8.1.13
  • Splade JS Version (npm): 1.4.15
  • Splade PHP Version (composer): 1.4.15.1
  • Dev environment (OS, Sail/Valet/etc): Windows 10 Pro.

Description:

When working with dynamically created form, validation errors don't display.

Steps To Reproduce Issue:

        <x-splade-form
            default="{
                receivers : [
                    {
                        full_name: '',
                    }
                ],
        
            }"
        
        >
              <template v-for="(receiver, index) in form.receivers" key="index">
                  ...
                  // this works
                  <x-splade-input v-model="receiver.full_name" label="Full Name" validation-key="receivers.0.full_name" class="mb-2" />
                  // this fails
                  <x-splade-input v-model="receiver.full_name" label="Full Name" validation-key="`receivers.${index}.full_name`" class="mb-2" />
                  ...
              </template>
         </splade-form>

Seems the validation-key attribute does not parse its value like v-text <span v-text="`receivers.${index}.full_name`"></span>does

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

No branches or pull requests

1 participant