Validation now runs only when Create Ticket is clicked.

* Removed the live body binding causing premature $commit.
* Details editor still syncs before submit.
* Added duplicate-submit guard.
* Should no longer need clicking Save/Create twice.
* Append-only changelog.
* module.json version 1.9.42.
This commit is contained in:
Mark Gregory
2026-06-23 11:13:54 +01:00
parent 7c4a94b5ea
commit 4ee0b8e604
6 changed files with 92 additions and 39 deletions
@@ -15,9 +15,10 @@ final class TicketCreateEditorSyncFilesTest extends TestCase
$view = file_get_contents(base_path('Modules/Helpdesk/Resources/views/livewire/ticket-create.blade.php'));
$this->assertIsString($view);
$this->assertStringContainsString('wire:model.live="body"', $view);
$this->assertStringContainsString('wire:model="body"', $view);
$this->assertStringContainsString("window.Livewire.find(livewireId).set('body', value, false)", $view);
$this->assertStringContainsString("form.addEventListener('submit', syncBody, { capture: true })", $view);
$this->assertStringNotContainsString('wire:model.live="body"', $view);
$this->assertStringContainsString("document.addEventListener('livewire:navigated', initialiseTicketCreateEditor)", $view);
$this->assertStringContainsString("editor.addEventListener('paste', () => window.setTimeout(syncBody, 0))", $view);
}