I have a “sub-menu” that allows users to increment numbered lists via a couple of buttons. The sub-menu should only display when the user has
$cursor inside of the list. However, when I click the buttons, the cursor is forced to the end of the list (and since the buttons are decorations, that means I have to then check what the prior node is to display the decoration again). if i was only dealing with 1D lists, it wouldn’t be a problem. but any deeper and I hit the same problem; I’m dumped out of the inner-list(s) and the outer-list… Let me show you what I mean:
It doesn’t feel like a nice solution to have to read through the prior nodes and make them visible in relation to the cursor position, i’ve tried to set a NodeSelection at the end of the transaction chain (using
setSelection) I even tried using TextSelection set to the first text within the list but the transaction still dumps me after the list whatever I do. Any ideas how I could force the transaction to jump back to the first
<li> rather than the subsequent paragraph?