awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
261 stars 71 forks source link

Custom extension doesn't work when the TipTap editor is invisible when the page is loaded #261

Closed MMonhemius closed 8 months ago

MMonhemius commented 8 months ago

Filament Version

v3.1.23

Plugin Version

v3.2.11

PHP Version

PHP 8.1.0

Problem description

I have made a custom extension for our TipTap editor. When used in a form where the TipTap editor is visible on page load, it works as expected. But we also use it in forms where the TipTap editor can be added in a repeater. In these cased, the custom extension throws an error when clicking on the toolbar button. In our case:

Alpine Expression Error: editor(...).commands.toggleFlexContainer is not a function

We tested the same page with a TipTap editor above the repeater that is always visible. In this case, the TipTap editor in the repeater works as expected again.

Expected behavior

We expected the custom extension to be exposed to the window object, even if it's not visible on page load.

Steps to reproduce

Reproduction repository

No response

Relevant log output

No response