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

Add support for read-only and non-selectable elements (#5374)

* Add `isElementReadOnly`

fix delete while selected

fix type while selected

fix failing test

add tests

add e2e test

linter fixes

add changeset

* fix yarn build:next

* Add `isSelectable`
This commit is contained in:
Joe Anderson
2023-04-03 19:02:26 +01:00
committed by GitHub
parent 26ace0db28
commit b52e08b0ea
22 changed files with 416 additions and 20 deletions

View File

@@ -0,0 +1,7 @@
---
'slate': minor
---
- Add `isSelectable` to `editor` (default true). A non-selectable element is skipped over when navigating using arrow keys.
- Add `ignoreNonSelectable` to `Editor.nodes`, `Editor.positions`, `Editor.after` and `Editor.before` (default false)
- `Transforms.move` ignores non-selectable elements

View File

@@ -0,0 +1,5 @@
---
'slate': minor
---
- Add `isElementReadOnly` to `editor`. A read-only element behaves much like a void with regard to selection and deletion, but renders its `children` the same as any other non-void node.