Skip to content

Commit

Permalink
Prevent default action for form submit event in PivotConfiguration.…
Browse files Browse the repository at this point in the history
… (3.2) (#7815)

* Prevent default action for form submit event in `PivotConfiguration`.

Before this change, the default action for the form submit event
triggered by submitting the `PivotConfiguration` form was not prevented.
This lead to a redirect happening in some browsers (namely Safari),
while working as expected on others (Chrome/ium).

This change is now preventing the form submit event to fix this for
Safari and others.

Fixes #7806.

* Prevent default action for form submit event in `EditableTitle`.

* Fixing linter hint.
  • Loading branch information
dennisoelkers committed Apr 3, 2020
1 parent ce81537 commit 9ebb244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -31,8 +31,11 @@ export default class PivotConfiguration extends React.Component {
};
}

// eslint-disable-next-line react/destructuring-assignment
_onSubmit = () => this.props.onClose(this.state);
_onSubmit = (e) => {
e.preventDefault();
const { onClose } = this.props;
onClose(this.state);
};

_onChange = config => this.setState({ config });

Expand Down
Expand Up @@ -42,7 +42,8 @@ export default class EditableTitle extends React.Component {
this.setState({ value: evt.target.value });
};

_onSubmit = () => {
_onSubmit = (e) => {
e.preventDefault();
const { value } = this.state;
const { onChange, value: propsValue } = this.props;
if (value !== '') {
Expand Down

0 comments on commit 9ebb244

Please sign in to comment.