mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:48:13 +08:00
fix: 公式变量点选时嵌套问题 (#4974)
This commit is contained in:
parent
4de1093d6d
commit
3860549a48
@ -35,6 +35,7 @@ export class FormulaPlugin {
|
||||
if (value) {
|
||||
// todo functions 也需要自动替换
|
||||
this.autoMark(variables!);
|
||||
this.focus(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +77,7 @@ export class FormulaPlugin {
|
||||
if (braces.length) {
|
||||
for (let index = 0; index < braces.length; index++) {
|
||||
const brace = braces[index];
|
||||
if (from > brace.begin && to <= brace.end) {
|
||||
if (from >= brace.begin && to <= brace.end) {
|
||||
isIn = true;
|
||||
break;
|
||||
}
|
||||
@ -228,6 +229,14 @@ export class FormulaPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
// 焦点放在最后
|
||||
focus(value: string) {
|
||||
this.editor.setCursor({
|
||||
line: 0,
|
||||
ch: value?.length || 0
|
||||
});
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
|
||||
validate() {}
|
||||
|
Loading…
Reference in New Issue
Block a user