Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Table only works in the first editor that makes the call, and stops working in the second #1494

Open
leonardogtc opened this issue Oct 30, 2024 · 1 comment

Comments

@leonardogtc
Copy link

leonardogtc commented Oct 30, 2024

I have a problem with the table component.
It only works in the first editor that makes the call, and stops working in the second:

<script>
    $('#trumbowyg-demo').trumbowyg({
        btns: [
            ['table', 'tableCellBackgroundColor', 'tableBorderColor'],
        ],
        plugins: {
            table: {
                // Some table plugin options, see details below
            }
        }
    });

</script>
<script>
    $('#trumbowyg-dem').trumbowyg({
        btns: [
            ['table', 'tableCellBackgroundColor', 'tableBorderColor'],
        ],
        plugins: {
            table: {
                // Some table plugin options, see details below
            }
        }
    });
</script>

It works correctly on #trumbowyg-demo, as it was the first one called.
It does not work on #trumbowyg-dem or any subsequent calls.

The error displayed in the console is:
Uncaught TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect')

@emailagency
Copy link

Running into same issue. Seems it's linked to the prefix somehow, as if I prefix each editor separately, the error does go away. however, not styling 4 editors separately. Will look into a little more, once I get time. For now, I'm loading the editors in separate tabs, so that I can create and destroy them individually on tab change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants