awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.
MIT License
281 stars 77 forks source link

Bubble menu actions is not working #337

Closed fordiquez closed 7 months ago

fordiquez commented 7 months ago

Filament Version

v.3.2.41

Plugin Version

v3.2.25

PHP Version

8.2.15

Problem description

When selecting an action on the selected text from the bubble menu, the actions do not work (TypeError: editor(...).chain(...).focus(...).toggleStrike is not a function)\ Loom video description

Expected behavior

The selected action from the bubble menu is applied to the selected text

Steps to reproduce

Install the plugin and initialize it in the Resource form:

TiptapEditor::make('text')
        ->required()
        ->profile('minimal')
        ->output(TiptapOutput::Json)

Reproduction repository

No response

Relevant log output

No response

awcodes commented 7 months ago

Are you seeing any console errors? I'm thinking this might be an alpine issue and not a plugin issue.

chrismcintosh commented 7 months ago

I've tried to use this plugin in two separate projects and ran into issues with the tip tap editor not allowing the toolbar actions to work (bold, underline)

  1. An existing project
  2. A project with only the bare minimum for this plugin to work so I could test in isolation

I was not able to get this plugin to work properly I might have missed something in documentation.

I opened a git project that replicates the issue here with a sqlite database already setup (from the second project) so that you can see the issue if you care to look into it - I saw there were a few other similar issues.

Screenshot 2024-03-02 at 1 36 22 PM

You should be able to login to filament using email: admin@sample.com password: password

https://github.com/chrismcintosh/filamenttiptap-editorissue

awcodes commented 7 months ago

Screenshot 2024-03-02 at 4 07 11 PM

Either use ->profile() or ->tools() don't use both. 😀

chrismcintosh commented 7 months ago

I'll give that a shot! Thanks so much!

chrismcintosh commented 7 months ago

Either use ->profile() or ->tools() don't use both. 😀

Can confirm this fixes the issue I was having.

fordiquez commented 7 months ago

Either use ->profile() or ->tools() don't use both. 😀

Can confirm this fixes the issue I was having.

No, but it works if elements from bubble_menu_tools are contained in the profiles in the config file.

Like this: 'minimal' => ['bold', 'italic', 'link', 'strike', 'underline', 'superscript', 'subscript', 'lead', 'small', 'bullet-list', 'ordered-list'], 'bubble_menu_tools' => ['bold', 'italic', 'strike', 'underline', 'superscript', 'subscript', 'lead', 'small', 'link'],