non working comments

This commit is contained in:
Mark Gregory
2026-06-17 08:33:20 +01:00
parent 04825b61ad
commit 15e62bfb40
5 changed files with 61 additions and 25 deletions
@@ -12,14 +12,16 @@
<div
{{ $attributes->whereDoesntStartWith('wire:model')->merge(['class' => 'space-y-2']) }}
@if($model) data-helpdesk-editor-model="{{ $model }}" @endif
x-on:helpdesk-editor-reset.window="if ($event.detail.model === model) clear()"
x-on:helpdesk-editor-sync.window="if ($event.detail.model === model) sync()"
x-data="{
model: @js($model),
value: @js($initialValue),
sync() {
this.value = this.$refs.editor.innerHTML;
if (this.model) {
this.$wire.set(this.model, this.value, false);
this.$wire.set(this.model, this.value);
}
},
command(action, value = null) {
@@ -31,7 +33,7 @@
this.value = '';
this.$refs.editor.innerHTML = '';
if (this.model) {
this.$wire.set(this.model, '', false);
this.$wire.set(this.model, '');
}
},
init() {
@@ -60,7 +62,9 @@
<div
x-ref="editor"
contenteditable="true"
x-on:input.debounce.300ms="sync"
x-on:input.debounce.150ms="sync"
x-on:keyup="sync"
x-on:paste="$nextTick(() => sync())"
x-on:blur="sync"
class="prose prose-sm min-h-[{{ (int) $rows * 28 }}px] max-w-none bg-white p-4 text-sm text-zinc-900 outline-none dark:prose-invert dark:bg-zinc-950 dark:text-zinc-100"
data-placeholder="{{ $placeholder }}"