Skip to content

Latest commit

 

History

History
 
 

slate-collapse-on-escape

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

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}
/>
Option Type Description
toEdge String The edge to collapse to, either: 'start', 'end', 'anchor' or 'focus'. Defaults to 'start'.