You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 2, 2024. It is now read-only.
When using any slate version newer than 0.88.1 (e.g. the next version 0.90.0), copy-paste functionality in our editors (Lookup editor, markdown editor) is broken.
The problem seems to be in editor.insertFragment()this line computes the wrong value for inlinePath. Before, it computes [0, 0] but now it computes [] and as a result, the call to splitNodes() splits the parent paragraph into two paragraphs instead of just splitting the text node into two text nodes.
The diff between those two versions of Slate.js is here though I can't easily tell what the problem is, it seems like it's likely related to the new Element.isElement() calls ?
Editor.children is '[{"type":"paragraph","block":true,"children":[{"type":"text","text":"abcdef"}]}]'
On 0.88.1, just the text node gets split into two. On 0.90.0+, the paragraph node gets split into two paragraphs.
The text was updated successfully, but these errors were encountered:
bradenmacdonald
changed the title
Copy-paste not working in Slate Editors
Cannot upgrade Slate.js paste 0.88.1: Copy-paste not working
Mar 24, 2023
bradenmacdonald
changed the title
Cannot upgrade Slate.js paste 0.88.1: Copy-paste not working
Cannot upgrade Slate.js past 0.88.1: Copy-paste not working
Mar 24, 2023
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When using any
slate
version newer than0.88.1
(e.g. the next version0.90.0
), copy-paste functionality in our editors (Lookup editor, markdown editor) is broken.The problem seems to be in
editor.insertFragment()
this line computes the wrong value forinlinePath
. Before, it computes[0, 0]
but now it computes[]
and as a result, the call tosplitNodes()
splits the parent paragraph into two paragraphs instead of just splitting the text node into two text nodes.The diff between those two versions of Slate.js is here though I can't easily tell what the problem is, it seems like it's likely related to the new
Element.isElement()
calls ?Simple test case: http://junction.local.neolace.net:5555/lookup?e=abcdef
Editor.children is
'[{"type":"paragraph","block":true,"children":[{"type":"text","text":"abcdef"}]}]'
On 0.88.1, just the text node gets split into two. On 0.90.0+, the paragraph node gets split into two paragraphs.
The text was updated successfully, but these errors were encountered: