feat: add emoji picker to post editor
This commit is contained in:
parent
061e38a78f
commit
9edd61db78
4 changed files with 78 additions and 9 deletions
|
|
@ -19,6 +19,7 @@ import suggestion from './suggestion'
|
|||
|
||||
export type TPostTextareaHandle = {
|
||||
appendText: (text: string) => void
|
||||
insertText: (text: string) => void
|
||||
}
|
||||
|
||||
const PostTextarea = forwardRef<
|
||||
|
|
@ -94,6 +95,11 @@ const PostTextarea = forwardRef<
|
|||
.insertContent(text)
|
||||
.run()
|
||||
}
|
||||
},
|
||||
insertText: (text: string) => {
|
||||
if (editor) {
|
||||
editor.chain().focus().insertContent(text).run()
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue