diff --git a/examples/composition/index.js b/examples/composition/index.js index bf47c462d..09c76a091 100644 --- a/examples/composition/index.js +++ b/examples/composition/index.js @@ -8,6 +8,7 @@ import splitJoin from './split-join.js' import insert from './insert.js' import special from './special.js' import empty from './empty.js' +import remove from './remove.js' import { isKeyHotkey } from 'is-hotkey' import { Button, EditorValue, Icon, Instruction, Toolbar } from '../components' import { ANDROID_API_VERSION } from 'slate-dev-environment' @@ -75,6 +76,7 @@ const SUBPAGES = [ ['Insertion', insert, 'insert'], ['Special', special, 'special'], ['Empty', empty, 'empty'], + ['Remove', remove, 'remove'], ] /** diff --git a/examples/composition/remove.js b/examples/composition/remove.js new file mode 100644 index 000000000..f247d7379 --- /dev/null +++ b/examples/composition/remove.js @@ -0,0 +1,18 @@ +import { p, text, bold } from './util' + +export default { + text: `Select from ANCHOR to FOCUS then press backspace. Move cursor to end. Backspace over all the remaining content.`, + document: { + nodes: [ + p(text('Go and '), bold('select'), text(' from this ANCHOR and then')), + p(text('go and select')), + p(text('to this FOCUS then press '), bold('backspace.')), + p(text('After you have done that move selection to very end.')), + p( + text('Then try '), + bold('backspacing'), + text(' over all remaining text.') + ), + ], + }, +}