awcodes / filament-tiptap-editor

A Rich Text Editor plugin for Filament Forms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Applying styles to elements applies them to the last element on the page instead of the target

RobertsG opened this issue · comments

Filament Version

v3.0-stable

Plugin Version

v3.2.2

PHP Version

PHP 8.1.0

Problem description

When using the editor while having multiple new lines of text and applying any of the styles for each line individually (for this example we can use H1, H2, H3 and so on tags.), the style gets applied to the last text entry in the editor instead of the selected one.

Expected behavior

When selecting a text element and applying a style to it I would expect it to be applied to the selected element instead of the last element in the editor.

Steps to reproduce

The easiest way to reproduce this is by typing out
H1
H2
H3
H4
H5
H6

Then attempting to select each element and attempting to apply an H1 tag to each of them individually, the issue will present it self either on the first attempt or the second, at which point the style will be applied to the H6 (the last text in the editor) instead of the selected text.

Reproduction repository

No response

Relevant log output

No response