fix(prompt-editor): resolve initial cursor position and auto-newline … (#8511)
### What problem does this PR solve? In web folder's prompt-editor component, when entering content for the first time, the cursor position is abnormal and it will automatically wrap ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: leonlai <owllai123456>
This commit is contained in:
parent
d768130204
commit
2990779d59
1 changed files with 3 additions and 0 deletions
|
|
@ -224,6 +224,9 @@ export default function VariablePickerMenuPlugin({
|
||||||
}
|
}
|
||||||
|
|
||||||
$getRoot().clear().append(paragraph);
|
$getRoot().clear().append(paragraph);
|
||||||
|
if ($isRangeSelection($getSelection())) {
|
||||||
|
$getRoot().selectEnd();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[findLabelByValue],
|
[findLabelByValue],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue