mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 修复编辑器切换面板自动滚动到中间的问题 (#11193)
This commit is contained in:
parent
b319016d88
commit
1074006b88
@ -250,7 +250,7 @@ export default class FormulaControl extends React.Component<
|
||||
this.props
|
||||
);
|
||||
const rawType =
|
||||
utils.RAW_TYPE_MAP[rendererSchema.type as SchemaType] || 'string';
|
||||
utils.RAW_TYPE_MAP[rendererSchema?.type as SchemaType] || 'string';
|
||||
const filterVars = variables
|
||||
.map(item => {
|
||||
if (item.children && item.type !== 'quickVars') {
|
||||
|
@ -48,7 +48,8 @@ export class CodeMirrorEditor extends React.Component<CodeMirrorEditorProps> {
|
||||
this.props.editorFactory?.(this.dom.current!, cm, this.props) ??
|
||||
cm(this.dom.current!, {
|
||||
value: this.props.value || '',
|
||||
readOnly: this.props.readOnly ? 'nocursor' : false
|
||||
readOnly: this.props.readOnly ? 'nocursor' : false,
|
||||
autofocus: false
|
||||
});
|
||||
|
||||
this.props.editorDidMount?.(cm, this.editor);
|
||||
@ -56,7 +57,7 @@ export class CodeMirrorEditor extends React.Component<CodeMirrorEditorProps> {
|
||||
this.editor.on('blur', this.handleBlur);
|
||||
this.editor.on('focus', this.handleFocus);
|
||||
|
||||
this.setValue(this.props.value);
|
||||
this.props.value && this.setValue(this.props.value);
|
||||
|
||||
this.toDispose.push(
|
||||
resizeSensor(this.dom.current as HTMLElement, () =>
|
||||
|
Loading…
Reference in New Issue
Block a user