GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.94k stars 393 forks source link

Regions doesn't show some elements #554

Open Jakuboslav opened 4 years ago

Jakuboslav commented 4 years ago

Hello, I am struggling with regions. I have a Tool that extends ContentEdit.Element (Changing for ContentEdit.Text behaves the same). When I use

                spElement = new SocialPostElement(
                    'div', {
                        'id': id,
                        'url': url
                        'type': @type
                    })

Element is ignored in Region, but if I use default

                spElement = new ContentEdit.Text(
                    'div', {
                        'id': id,
                        'url': url
                        'type': @type
                    },'placeholder')

It is shown in Region. I tried to add defined data-ce-tag but, it didn't help. Adding some placeholder as third parameter doesnt help either.

Is there something I am missing? Do I need to register this tool anywhere in order to work?

Thanks in advance

anthonyjb commented 4 years ago

Hi @Jakuboslav sorry for the late reply - I'd really need to see the full code for your SocialPostElement in order to help much. My first guess based on what you've provided is maybe the fromDOMElement class method hasn't been overridden for your element type, is there any sort of error message in the console?