codenco-dev / nova-grid-system

Nova grid system for Laravel Nova
80 stars 33 forks source link

NovaGridSystem breaks Field->hide() logic #29

Open OverBurt opened 1 year ago

OverBurt commented 1 year ago

When add NovaGridSystem in NovaServiceProvider it breaks the ->hide() function in Fields on Form view:

public function tools()
    {
        return [
            new NovaGridSystem,
        ];
    }
Date::make(__('nova-control-panel.field.date_from'), 'date_from')
                ->sortable()
                ->rules([
                    'required'
                ])->dependsOn(
                    ['type'],
                    function (Date $field, NovaRequest $request, FormData $formData) {
                        if ($formData->type === null ) {
                            $field->hide();
                        }
                    }
                ),

Even if type is null field "date_from" is shown on Forms, on Detail it works perfectly.

Schermata 2023-05-18 alle 12 25 19

salmanhijazi commented 1 year ago

Hey, is a fix for this somewhere in the pipeline? Need to decide whether to use this package for a soon-to-be production environment.