Let’s say I have a bullet list with three list items and one of them is selected. How can I get the absolute position of the sibling before or after the selected item?
I looked through the ResolvedPos
methods, but couldn’t find a way to do this. The nodeBefore
and nodeAfter
properties give the correct node, but I need the position of the node and not the node itself.
My goal is being able to swap two items in a list by deleting an item and inserting it before or after its sibling. Maybe there’s a better way to achieve the swapping functionality?