Skip to content

KeyValue fields set to readonly are still editable #2188

@patrickgilmour

Description

@patrickgilmour
  • Laravel Version: 6.6.0
  • Nova Version: 2.8.0
  • PHP Version: 7.3.9
  • Database Driver & Version: MySQL 5.7.27
  • Operating System and Version: Ubuntu 18.04 (Homestead)
  • Browser type and version: Safari Mac 13.0.3

Description:

When fields of type KeyValue are set to readonly the content in the field can still be edited in the Edit view.

For example, in the following the 'Name' field is correctly disabled but the key/value pairs in the 'Preferences' field can be edited. On save, they are not saved, however.

Text::make('Name')->readonly(),
KeyValue::make('Preferences')->rules('json')->readonly(),

Steps To Reproduce:

Create a JSON Column in database. Create a Nova resource for the Model/column, and create field as above.

nova-keyvalue-updates-2

(This is the first time I've submitted an Nova/GitHub Issue; apologies in advance if I've messed something up)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified bug by the Nova team

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions