fix: 点击编辑页面向下滚动问题在火狐

This commit is contained in:
suxiaoxin 2017-10-13 16:41:13 +08:00
parent 3c2963ff4d
commit c1f6966590

View File

@ -252,6 +252,10 @@ class InterfaceEditForm extends Component {
}
editor.create();
editor.txt.html(this.state.desc)
if(navigator.userAgent.indexOf("Firefox")>0){
document.getElementById('title').focus()
}
}
componentWillUnmount() {
@ -518,7 +522,7 @@ class InterfaceEditForm extends Component {
return requestBodyTpl(item, index)
})
return (
<Form onSubmit={this.handleSubmit}>
<Form onSubmit={this.handleSubmit}>
<h2 className="interface-title" style={{ marginTop: 0 }}>基本设置</h2>
<div className="panel-sub">
@ -531,7 +535,7 @@ class InterfaceEditForm extends Component {
initialValue: this.state.title,
rules: nameLengthLimit('接口')
})(
<Input placeholder="接口名称" />
<Input id="title" placeholder="接口名称" />
)}
</FormItem>