File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change 3
3
---
4
4
5
5
- Added ` getSelectedDomFragment ` utility function that returns Slate nodes from DOM selection.
6
-
7
- ``` ts
8
- // Before: Using getSelectedDomBlocks
9
- const domBlocks = getSelectedDomBlocks ();
10
- const fragment: Descendant [] = [];
11
- domBlocks .forEach ((node ) => {
12
- const blockId = node .dataset .slateId ;
13
- const block = editor .api .node ({ id: blockId , at: [] });
14
- if (block && block [1 ].length === 1 ) {
15
- fragment .push (block [0 ]);
16
- }
17
- });
18
-
19
- // After: Using getSelectedDomFragment
20
- const fragment = getSelectedDomFragment (editor );
21
- ```
22
-
23
- - Deprecated ` getSelectedDomBlocks ` . Use ` getSelectedDomFragment ` instead.
6
+ - Deprecated ` getSelectedDomBlocks ` . Use ` getSelectedDomFragment ` instead.
You can’t perform that action at this time.
0 commit comments