js erro fixes

This commit is contained in:
Mark Gregory
2026-06-29 13:46:07 +01:00
parent faea90cb62
commit 9cc5400063
4 changed files with 112 additions and 47 deletions
@@ -22,7 +22,17 @@
}
const editor = document.querySelector('[data-helpdesk-sync-target="body"], [data-helpdesk-editor-model="body"]');
const target = document.querySelector('textarea[wire\:model\.defer="body"], textarea[name="body"], #body');
const target = Array.from(document.querySelectorAll('textarea')).find(function (textarea) {
return textarea.getAttribute('wire:model.defer') === 'body'
|| textarea.getAttribute('wire:model') === 'body'
|| textarea.getAttribute('name') === 'body'
|| textarea.id === 'body';
});
const body = (editor?.innerText || editor?.textContent || editor?.value || '').trim();
if (target) {