1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-16 04:04:06 +02:00

Fix overly-aggressive unhangRange (#5193)

`Editor.unhangRange()` could decide to proceed with an adjustment in cases where the range was not hanging.
Because the algorithm it uses *always* skips over the first node it encounters, this meant the selection was adjusted in non-hanging cases.
This change reduces the chances of an incorrect decision to adjust.
Transforms now pass the `voids` flag to `unhangRange()` as it seems logical that the adjusted range should reflect the intention of the operation.
This fixes a unit test I added for markable voids that had to be skipped because of the `unhangRange()` error, and fixes a couple other long-skipped tests.
This commit is contained in:
Brian Bucknam
2022-11-17 09:18:11 -08:00
committed by GitHub
parent c8c75e9e2d
commit 6909a8f7da
13 changed files with 183 additions and 12 deletions

View File

@@ -0,0 +1,5 @@
---
'slate': patch
---
Stops Editor.unhangRange() from adjusting the range in some cases when it was not actually hanging