Clean up empty HTML and help text in form inputs (#700)
* Clean up empty HTML and help text in form inputs * Update api/app/Http/Requests/UserFormRequest.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Julien Nahum <julien@nahum.net> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -95,6 +95,14 @@ const emit = defineEmits(['update:modelValue'])
|
||||
const { compVal, inputStyle, hasError, inputWrapperProps } = useFormInput(props, { emit })
|
||||
const editor = ref(null)
|
||||
const mentionState = ref(null)
|
||||
|
||||
// Add this watch to clean up empty HTML content
|
||||
watch(compVal, (val) => {
|
||||
if (val && val.replace(/<[^>]*>/g, '').trim() === '') {
|
||||
compVal.value = null
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
// Move the mention extension registration to onMounted
|
||||
|
||||
if (props.enableMentions && !Quill.imports['blots/mention']) {
|
||||
|
||||
Reference in New Issue
Block a user