laravel / nova-issues

554 stars 35 forks source link

dependsOn() not working with two Markdown fields #4712

Closed joschaefer closed 2 years ago

joschaefer commented 2 years ago

Description:

I have two Markdown fields in a resource. I want one the second one to update its value when the first one changes (for testing I just simplified the manipulation). Nothing updates in _messagede when I change the value of the first Markdown _messageen.

Markdown::make('Message en')
    ->required()
    ->rules('required', 'string', 'max:3000'),

Markdown::make('Message de')
    ->required()
    ->rules('required', 'string', 'max:3000')
    ->dependsOn('message_en', function (Markdown $field, NovaRequest $request, FormData $formData) {
        $field->value = $formData->message_en;
    }),

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. Create a new model
  2. Add the code above
  3. Run and see that the value of the second field does not change when the first field is updated
github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.