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:
FatMii 2025-06-26 19:28:46 +08:00 committed by GitHub
parent d768130204
commit 2990779d59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,6 +224,9 @@ export default function VariablePickerMenuPlugin({
}
$getRoot().clear().append(paragraph);
if ($isRangeSelection($getSelection())) {
$getRoot().selectEnd();
}
},
[findLabelByValue],
);