mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-01 06:37:51 +08:00
21 lines
353 B
TypeScript
21 lines
353 B
TypeScript
import { Command, Commands } from '../types'
|
|
|
|
declare module '@tiptap/core' {
|
|
interface AllCommands {
|
|
blur: {
|
|
/**
|
|
* Removes focus from the editor.
|
|
*/
|
|
blur: () => Command,
|
|
}
|
|
}
|
|
}
|
|
|
|
export const blur: Commands['blur'] = () => ({ view }) => {
|
|
const element = view.dom as HTMLElement
|
|
|
|
element.blur()
|
|
|
|
return true
|
|
}
|