mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 10:14:02 +02:00
only apply Firefox toSlatePoint offset fix if ending in \n\n
(#4552)
This commit is contained in:
@@ -515,7 +515,7 @@ export const ReactEditor = {
|
||||
// COMPAT: In Firefox, `range.cloneContents()` returns an extra trailing '\n'
|
||||
// when the document ends with a new-line character. This results in the offset
|
||||
// length being off by one, so we need to subtract one to account for this.
|
||||
(IS_FIREFOX && domNode.textContent?.endsWith('\n')))
|
||||
(IS_FIREFOX && domNode.textContent?.endsWith('\n\n')))
|
||||
) {
|
||||
offset--
|
||||
}
|
||||
|
Reference in New Issue
Block a user