@@ -95,9 +95,9 @@ const TextBubbleEditorContent = ({
|
|||||||
const handleVariableSelected = (variable?: Variable) => {
|
const handleVariableSelected = (variable?: Variable) => {
|
||||||
setIsVariableDropdownOpen(false)
|
setIsVariableDropdownOpen(false)
|
||||||
if (!rememberedSelection.current || !variable) return
|
if (!rememberedSelection.current || !variable) return
|
||||||
|
ReactEditor.focus(editor as unknown as ReactEditor)
|
||||||
Transforms.select(editor as BaseEditor, rememberedSelection.current)
|
Transforms.select(editor as BaseEditor, rememberedSelection.current)
|
||||||
Transforms.insertText(editor as BaseEditor, '{{' + variable.name + '}}')
|
Transforms.insertText(editor as BaseEditor, '{{' + variable.name + '}}')
|
||||||
ReactEditor.focus(editor as unknown as ReactEditor)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user