Skip to content

Commit

Permalink
fix(editor): 文本表达式输入${}唤起表达书输入时缺少变量内容 (baidu#9456)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwei9012 committed Jan 17, 2024
1 parent a6256b4 commit d97b7f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/amis-editor/src/renderer/TplFormulaControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class TplFormulaControl extends React.Component<
}

// 检测用户输入'${}'自动打开表达式弹窗
checkOpenFormulaPicker(value: string) {
async checkOpenFormulaPicker(value: string) {
const preLength = this.props.value?.length || 0;
// 删除了文本,无需检测
if (value.length < preLength || value === this.props.value) {
Expand Down Expand Up @@ -251,6 +251,10 @@ export class TplFormulaControl extends React.Component<
value.slice(end);
this.props.onChange(newValue);

try {
await this.beforeFormulaEditorOpen();
} catch (error) {}

const corsur = this.editorPlugin.getCorsur();
this.setState({
formulaPickerOpen: true,
Expand Down

0 comments on commit d97b7f1

Please sign in to comment.