Open f1ames opened 2 months ago
This is simple to replicate without tracked changes:
The issue is reproducible in blocks that contain 2+ occurrences of queried sequence. If there is only one occurrence, the selection is moved as expected.
https://github.com/user-attachments/assets/12e88a5a-02e0-45a6-9c56-810d6d7a28a0
https://github.com/user-attachments/assets/5afaccba-e61b-43b0-b5d7-f0360213a0a5
📝 Provide detailed reproduction steps (if any)
I'll start with videos since it illustrates this case nicely.
1st example works fine, and replace cycles nicely over words in order:
https://github.com/cksource/ckeditor5-commercial/assets/1061942/678d2099-5e1a-4a77-acef-43c844cb4ca0
2nd and 3rd shows that highlight sometimes jumps to the first item:
https://github.com/cksource/ckeditor5-commercial/assets/1061942/82279342-3e5f-446a-89bb-3b08bc81f928
https://github.com/cksource/ckeditor5-commercial/assets/1061942/0054df5f-27ed-4b23-9393-36c1f3c65059
Steps
As in 3rd video:
✔️ Expected result
Replace should cycle over items in order.
❌ Actual result
Sometimes highlight jumps to first item.
❓ Possible solution
Not sure, I was suspecting complex structure and first item in a block/paragraph but was not able to confirm that with quick testing.
📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.