fix(xo-web/modal#form): prevent default behavior of submit (#3462)

This commit is contained in:
badrAZ 2018-09-28 11:42:47 +02:00 committed by Julien Fontanet
parent 7298a8b8f0
commit 3f1fb7092b
2 changed files with 4 additions and 1 deletions

View File

@ -45,6 +45,7 @@
- [Backup NG] Fix issue when *Delete first* was enabled for some of the remotes [#3424](https://github.com/vatesfr/xen-orchestra/issues/3424) (PR [#3427](https://github.com/vatesfr/xen-orchestra/pull/3427))
- [VM/host consoles] Work around a XenServer/XCP-ng issue which lead to some consoles not working [#3432](https://github.com/vatesfr/xen-orchestra/issues/3432) (PR [#3435](https://github.com/vatesfr/xen-orchestra/pull/3435))
- [Backup NG] Remove extraneous snapshots in case of multiple schedules [#3132](https://github.com/vatesfr/xen-orchestra/issues/3132) (PR [#3439](https://github.com/vatesfr/xen-orchestra/pull/3439))
- [Backup NG] Fix page reloaded on creating a schedule [#3461](https://github.com/vatesfr/xen-orchestra/issues/3461) (PR [#3462](https://github.com/vatesfr/xen-orchestra/pull/3462))
### Released packages

View File

@ -259,6 +259,8 @@ export const confirm = ({ body, icon = 'alarm', title, strongConfirm }) =>
// -----------------------------------------------------------------------------
const preventDefault = event => event.preventDefault()
class FormModal extends BaseComponent {
state = {
value: this.props.defaultValue,
@ -271,7 +273,7 @@ class FormModal extends BaseComponent {
render () {
const { body, formId } = this.props
return (
<form id={formId}>
<form id={formId} onSubmit={preventDefault}>
{cloneElement(body, {
value: this.state.value,
onChange: this.linkState('value'),