Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

uloncl's avatar

quilljs invalid quill container

so i thought this issue was that the div was inactive so i added a mutationobserver to wait for the parent element to become active before trying to make the div into a quill but i still get the error and cant find much information about it. im not very familar with mutation observers but the console.log works so but the code after it doesnt. the quilljs github is very inactive

<script>
        $(document).ready(function() {
            const repairFormDiv = document.querySelector('#new-repair-content')
            const options = {
                attributes: true
            }

            function callback(mutationList, observer) {
                mutationList.forEach(function(mutation) {
                    if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
                        console.log('repairs now active');
                        var newRepair = new Quill('#action-taken', {
                            placeholder: 'Describe the steps taken...',
                            theme: 'snow',
                            modules: {
                                toolbar: [
                                    ['bold', 'italic', 'underline'],
                                    ['blockquote', 'code-block'],
                                    ['link'],
                                    [{
                                        'list': 'ordered'
                                    }, {
                                        'list': 'bullet'
                                    }],
                                    [{
                                        'indent': '-1'
                                    }, {
                                        'indent': '+1'
                                    }],
                                    ['clean']
                                ]
                            }
                        });
                    }
                })
            }

            const observer = new MutationObserver(callback)
            observer.observe(repairFormDiv, options)
        });
    </script>
0 likes
1 reply
uloncl's avatar
<div id="action-taken " class="ql-container ql-snow mb-3 rounded-bottom"></div>

Please or to participate in this conversation.