add blur command
This commit is contained in:
16
packages/core/src/commands/blur.ts
Normal file
16
packages/core/src/commands/blur.ts
Normal 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()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export { default as blur } from './blur'
|
||||
export { default as clearContent } from './clearContent'
|
||||
export { default as deleteSelection } from './deleteSelection'
|
||||
export { default as focus } from './focus'
|
||||
|
||||
Reference in New Issue
Block a user