mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Fix ctm enter key press bug
This commit is contained in:
parent
2418686b7b
commit
be14886b79
@ -107,8 +107,6 @@ export class Edit extends React.Component {
|
||||
} else {
|
||||
this.props.loadRecord(this.props.match.params.id);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', this.handleSubmitOnEnterPress);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -123,9 +121,9 @@ export class Edit extends React.Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('keydown', this.handleSubmitOnEnterPress);
|
||||
this.props.recordEdited();
|
||||
this.props.resetEditSuccess();
|
||||
this.props.setInitialState();
|
||||
}
|
||||
|
||||
handleChange = (e) => {
|
||||
@ -153,12 +151,6 @@ export class Edit extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleSubmitOnEnterPress = (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
this.handleSubmit(e);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.loading || !this.props.schema || !this.props.currentModelName) {
|
||||
return <p>Loading...</p>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user