laravel / nova-issues

554 stars 35 forks source link

Resource with Trix field always prompts for save if that field has content even if no changes have been made. #4210

Closed cfc7-unikent closed 2 years ago

cfc7-unikent commented 2 years ago

Description:

When editing a resource with a Trix field. If that field contains content then the user is prompted to save changes when navigating away even when no changes have been made.

This does not occur when the Trix field is empty.

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

  1. Create new Laravel project, install Nova and configure DB and user

  2. Add migration to the user table to add a Text field and run the migration

    // from the migration file
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->text('description')->nullable(true);
        });
    }
  3. Add a Trix field to the User resource (app/Nova/User.php) to display the newly added in Nova

    public function fields(NovaRequest $request)
    {
        return [
    // default fields are here 
            Trix::make('Description');
        ];
    }
  4. Edit the User in Nova and add some content to the Trix field and save

  5. Return to the edit screen for that User and then attempt to navigate away by clicking on the left hand menu

  6. See the prompt to save changes even though you have made no changes.

Demo video attached

https://user-images.githubusercontent.com/31033292/167664586-d872bc5d-303c-4519-b7d0-886caffa8c0c.mp4

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.