diff --git a/assets/js/ticket.js b/assets/js/ticket.js index 09155a0..aa4a6ea 100644 --- a/assets/js/ticket.js +++ b/assets/js/ticket.js @@ -284,7 +284,15 @@ function addComment() { // Clear the comment box const nc = document.getElementById('newComment'); if (nc) nc.value = ''; - + + // Clear the live preview — clearing the textarea programmatically + // does not fire 'input', so updatePreview() never runs + const previewDiv = document.getElementById('markdownPreview'); + if (previewDiv) { + previewDiv.innerHTML = ''; + previewDiv.classList.add('is-hidden'); + } + // Format the comment text for display let displayText; if (isMarkdownEnabled) {