Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Feb 16, 2023
1 parent c368252 commit 2dc096a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .changeset/two-books-bow.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
"slate": patch
'slate': patch
---

- new `editor` method that can be overridden to control when the normalization should stop. Default behavior (unchanged) is to throw an error when it iterates over 42 times the dirty paths length.
New `editor` method that can be overridden to control when the normalization should stop. Default behavior (unchanged) is to throw an error when it iterates over 42 times the dirty paths length.

```ts
shouldNormalize: ({
iteration,
Expand All @@ -14,6 +15,7 @@ shouldNormalize: ({
operation?: Operation
}) => boolean
```

- `editor.onChange` signature change: `(options?: { operation?: Operation }) => void` where `operation` is triggering the function.
- `editor.normalizeNode` signature change: `(entry: NodeEntry, options?: { operation?: Operation }) => void` where `operation` is triggering the function.
- `EditorNormalizeOptions` new option `operation?: Operation` where `operation` is triggering the function.
1 change: 0 additions & 1 deletion docs/api/nodes/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ Override this method to prevent normalizing the editor.

Options: `{ iteration: number; dirtyPaths: Path[]; operation?: Operation(entry: NodeEntry, { operation }`


### Callback method

#### `onChange(options?: { operation?: Operation }) => void`
Expand Down

0 comments on commit 2dc096a

Please sign in to comment.