From 394a88688311efec54ce208ce2837b25c9144b2e Mon Sep 17 00:00:00 2001 From: Satya Date: Mon, 23 Jan 2017 12:31:26 +1100 Subject: [PATCH] COMPASS-696: Backport COMPASS-666: Keyboard Enter on forms cause page refresh (#753) * add missing onSubmit's * added functional tests --- .../components/create-collection-dialog.jsx | 11 ++- .../lib/components/drop-collection-dialog.jsx | 14 +++- .../lib/component/create-database-dialog.jsx | 9 ++- .../lib/component/drop-database-dialog.jsx | 14 +++- test/compass-functional.test.js | 75 +++++++++++++++++++ test/support/spectron-support.js | 11 +++ 6 files changed, 126 insertions(+), 8 deletions(-) diff --git a/src/internal-packages/database/lib/components/create-collection-dialog.jsx b/src/internal-packages/database/lib/components/create-collection-dialog.jsx index 90d15e0d1bc..99963b55612 100644 --- a/src/internal-packages/database/lib/components/create-collection-dialog.jsx +++ b/src/internal-packages/database/lib/components/create-collection-dialog.jsx @@ -73,8 +73,12 @@ class CreateCollectionDialog extends React.Component { /** * Initiate the attempt to create a collection. + * @param {Object} evt - The event object */ - onCreateCollectionButtonClicked() { + onCreateCollectionButtonClicked(evt) { + evt.preventDefault(); + evt.stopPropagation(); + this.setState({ inProgress: true, error: false, errorMessage: '' }); Actions.createCollection( this.state.databaseName, @@ -168,7 +172,10 @@ class CreateCollectionDialog extends React.Component { -
+ - +
- +
- +