@portabletext/editor
Version:
Portable Text Editor made in React
13 lines (11 loc) • 333 B
text/typescript
import {Transforms} from 'slate'
import type {BehaviorActionImplementation} from './behavior.actions'
export const moveBackwardActionImplementation: BehaviorActionImplementation<
'move.backward'
> = ({action}) => {
Transforms.move(action.editor, {
unit: 'character',
distance: action.distance,
reverse: true,
})
}