After a selection change, I see an extra step in my transaction, which is causing issues with decoration positioning.
In the following HTML, I highlighted the "23":
<p>
<strong>
<span inputsource="AREA_TYPED_TEXT">1-2</span>
</strong>
<reporting-field-start class="reporting-field"></reporting-field-start>
<span inputsource="AREA_TYPED_TEXT">
<span class="reporting-field">3-4</span>
</span>
</p>
Then I ran:
const newSet = oldStateDecoration.map(tr.mapping, tr.doc);
The tr.steps looks like this:
[
{
"stepType": "replace",
"from": 14,
"to": 19,
"slice": {
"content": [
{
"type": "text",
"marks": [
{ "type": "strong" },
{ "type": "colorCoding", "attrs": { "inputSource": "AREA_TYPED_TEXT" } }
],
"text": "x"
},
{
"type": "text",
"marks": [
{
"type": "style",
"attrs": {
"style": null,
"class": null,
"id": null
}
}
],
"text": "-4"
}
]
}
}
]
But I only highlighted 2 characters ("23"), so why is the mapping showing:
{
"maps": [
{
"ranges": [14, 5, 3],
"inverted": false
}
]
}
