0.8.1 • Published 5 years ago

slate-collapse-on-escape v0.8.1

Weekly downloads
1,911
License
MIT
Repository
github
Last release
5 years ago

slate-collapse-on-escape

A Slate plugin that simply collapses the selection on escape.

View Demo ⬈

import CollapseOnEscape from 'slate-collapse-on-escape'
import { Editor } from 'slate-react'

// Add the plugin to your set of plugins...
const plugins = [
  CollapseOnEscape()
]

// And later pass it into the Slate editor...
<Editor
  ...
  plugins={plugins}
/>
OptionTypeDescription
toEdgeStringThe edge to collapse to, either: 'start', 'end', 'anchor' or 'focus'. Defaults to 'start'.