Skip to content

Commit b7fe8c0

Browse files
authored
Merge pull request #17142 from TheSkybreaker/3.x
Dynamically disable JS inputs for v.3
2 parents 1169857 + db1c6e1 commit b7fe8c0

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

packages/forms/resources/views/components/file-upload.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
},
105105
})"
106106
wire:ignore
107+
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
108+
substr(md5(serialize([
109+
$isDisabled,
110+
])), 0, 64)
111+
}}"
107112
{{
108113
$attributes
109114
->merge([

packages/forms/resources/views/components/key-value.blade.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
x-load
4040
@endif
4141
x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('key-value', 'filament/forms') }}"
42-
wire:ignore
4342
x-data="keyValueFormComponent({
4443
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')") }},
4544
})"
@@ -48,6 +47,12 @@
4847
->merge($getExtraAlpineAttributes(), escape: false)
4948
->class(['divide-y divide-gray-200 dark:divide-white/10'])
5049
}}
50+
wire:ignore
51+
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
52+
substr(md5(serialize([
53+
$isDisabled,
54+
])), 0, 64)
55+
}}"
5156
>
5257
<table
5358
class="w-full table-auto divide-y divide-gray-200 dark:divide-white/5"

packages/forms/resources/views/components/rich-editor.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
44
$id = $getId();
55
$statePath = $getStatePath();
6+
$isDisabled = $isDisabled();
67
@endphp
78

89
<x-dynamic-component :component="$getFieldWrapperView()" :field="$field">
9-
@if ($isDisabled())
10+
@if ($isDisabled)
1011
<div
1112
x-data="{
1213
state: $wire.{{ $applyStateBindingModifiers("\$entangle('{$statePath}')") }},
@@ -377,6 +378,11 @@ class="trix-button trix-button--dialog"
377378
@endif
378379
x-ref="trix"
379380
wire:ignore
381+
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
382+
substr(md5(serialize([
383+
$isDisabled,
384+
])), 0, 64)
385+
}}"
380386
@if ($isGrammarlyDisabled())
381387
data-gramm="false"
382388
data-gramm_editor="false"

packages/forms/resources/views/components/select.blade.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ class="hidden"
153153
statePath: @js($statePath),
154154
})"
155155
wire:ignore
156+
wire:key="{{ $this->getId() }}.{{ $statePath }}.{{ $field::class }}.{{
157+
substr(md5(serialize([
158+
$isDisabled,
159+
])), 0, 64)
160+
}}"
156161
x-on:keydown.esc="select.dropdown.isActive && $event.stopPropagation()"
157162
x-on:set-select-property="$event.detail.isDisabled ? select.disable() : select.enable()"
158163
{{

0 commit comments

Comments
 (0)