whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
788 stars 228 forks source link

Flexible field disappears when using dependsOn() #381

Closed tesren closed 1 year ago

tesren commented 2 years ago

I have the following fields

           Text::make(__('Telephone Number'), 'tel')->rules('max:255')->nullable(),
            Flexible::make('More Information', 'more_info')->button('Add information')
            ->addLayout('Extra Info', 'wysiwyg', [

                Text::make(__('Telephone Number'))->rules('max:255')->nullable(),
                Email::make(__('Email'))->rules('max:255')->nullable(),

            ])
            ->dependsOn(
                ['tel'], 
                function (Flexible $field, NovaRequest $request, FormData $formData) {

                    if($formData->tel){

                        $field->show();

                    }

                }
            ),

And as soon as I type something in my Text field, the Flexible field disappears

I have the latest version of Nova(4.13.0) and the Flexible package(1.0.1), I know this is supposed to be fixed recently according to #366 and #347

https://user-images.githubusercontent.com/38506744/186996043-f88d0856-ddf2-48dd-b8c7-7194280556fa.mov