From 18a8fbcb41581aa1a6827dab945a28b0bce19940 Mon Sep 17 00:00:00 2001 From: David Vincent Date: Thu, 8 Sep 2022 09:25:18 +0200 Subject: [PATCH] Fix View mode Force mode to preview when field is disabled --- resources/views/json-editor.blade.php | 7 ------- src/Forms/JSONEditor.php | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/views/json-editor.blade.php b/resources/views/json-editor.blade.php index 247a057..e1f66db 100644 --- a/resources/views/json-editor.blade.php +++ b/resources/views/json-editor.blade.php @@ -49,15 +49,8 @@ })" x-cloak wire:ignore> - @unless($isDisabled())
- @else -
- @endunless diff --git a/src/Forms/JSONEditor.php b/src/Forms/JSONEditor.php index 9329a21..cd75b98 100644 --- a/src/Forms/JSONEditor.php +++ b/src/Forms/JSONEditor.php @@ -43,6 +43,10 @@ public function getHeight(): ?int public function getModes(): ?string { + if ($this->isDisabled()) + { + $this->modes = ['preview']; + } return json_encode($this->evaluate($this->modes)); }