fix focus
This commit is contained in:
parent
ea44468fad
commit
df64de5306
1 changed files with 2 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ const colorClassMap: Record<StatusColor, string> = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function StatusView(props: NodeViewProps) {
|
export default function StatusView(props: NodeViewProps) {
|
||||||
const { node, updateAttributes, deleteNode, editor } = props;
|
const { node, updateAttributes, deleteNode, editor, getPos } = props;
|
||||||
const { text, color } = node.attrs as {
|
const { text, color } = node.attrs as {
|
||||||
text: string;
|
text: string;
|
||||||
color: StatusColor;
|
color: StatusColor;
|
||||||
|
|
@ -109,6 +109,7 @@ export default function StatusView(props: NodeViewProps) {
|
||||||
onKeyDown={(e) => {
|
onKeyDown={(e) => {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
setOpened(false);
|
setOpened(false);
|
||||||
|
editor.commands.focus(getPos() + node.nodeSize);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
placeholder="Status text"
|
placeholder="Status text"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue