[Bug]: getMarkRange returned an incorrect value #5715
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Affected Packages
core
Version(s)
2.8.0
Bug Description
I recorded a video to demonstrate this bug.
2024-10-10.11.57.52.mov
As shown in the figure, clicking the link icon will select the entire link. This is achieved by using
editor.commands.extendMarkRange('link')
It works as expected
But if the selection is like the one below, it will not work as expected
This problem only occurs when the
$from
of the selection is at the beginning of the linkAfter debugging I found out that this is because
getMarkRange
returns undefinedAnd if I change the first parameter of
getMarkRange
from$from
to$to
I can get it to work correctly.I use the following code to meet my needs. But I prefer the simple
editor.commands.extendMarkRange('link')
Hope this problem can be solved
Browser Used
Chrome
Code Example URL
No response
Expected Behavior
getMarkRange
returns correct range.Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: