Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix(prompt-editor): resolve initial cursor position and auto-newline … (#8511)

FatMii2990779d5913
diff --git a/web/src/components/prompt-editor/variable-picker-plugin.tsx b/web/src/components/prompt-editor/variable-picker-plugin.tsx
index 7aeb798b6b..6e92d14f98 100644
--- a/web/src/components/prompt-editor/variable-picker-plugin.tsx
+++ b/web/src/components/prompt-editor/variable-picker-plugin.tsx
@@ -224,6 +224,9 @@ export default function VariablePickerMenuPlugin({
}
$getRoot().clear().append(paragraph);
+ if ($isRangeSelection($getSelection())) {
+ $getRoot().selectEnd();
+ }
},
[findLabelByValue],
);