add blur command

This commit is contained in:
Philipp Kühn
2020-08-21 23:50:22 +02:00
parent 119f7d1458
commit d4cd6ab691
2 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { Editor } from '../Editor'
type BlurCommand = () => Editor
declare module '../Editor' {
interface Editor {
blur: BlurCommand,
}
}
export default (next: Function, { view }: Editor) => () => {
const element = view.dom as HTMLElement
element.blur()
next()
}

View File

@@ -1,3 +1,4 @@
export { default as blur } from './blur'
export { default as clearContent } from './clearContent' export { default as clearContent } from './clearContent'
export { default as deleteSelection } from './deleteSelection' export { default as deleteSelection } from './deleteSelection'
export { default as focus } from './focus' export { default as focus } from './focus'