From adf8e186cb8ba6bd8d1513dd9454bb58509806f8 Mon Sep 17 00:00:00 2001 From: Giulio Cesare Solaroli Date: Wed, 23 Sep 2015 13:44:57 +0200 Subject: [PATCH] Avoided forced reload when hitting return on the password generator length field --- .../Clipperz/PM/UI/Components/Cards/PasswordGenerator.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/PasswordGenerator.js b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/PasswordGenerator.js index ad537c8..dbe0e4f 100644 --- a/frontend/delta/js/Clipperz/PM/UI/Components/Cards/PasswordGenerator.js +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Cards/PasswordGenerator.js @@ -127,11 +127,15 @@ Clipperz.PM.UI.Components.Cards.PasswordGeneratorClass = React.createClass({ }); }, + handleFormSubmit: function (anEvent) { + anEvent.preventDefault(); + }, + changeStateWithTargetValue: function (aKey, shouldUpdatePasswordValue) { var self = this; return function (anEvent) { var newState = {}; - + newState[aKey] = anEvent.target.value; self.setState(newState); @@ -174,7 +178,7 @@ Clipperz.PM.UI.Components.Cards.PasswordGeneratorClass = React.createClass({ result = React.DOM.div({'className':'passwordGenerator'}, [ React.DOM.div({'className':'passwordGeneratorMask', 'onClick':this.props['closeClallback']}), React.DOM.div({'className':'passwordGeneratorBaloon'}, [ - React.DOM.form({}, [ + React.DOM.form({'onSubmit':this.handleFormSubmit}, [ React.DOM.div({'className':'optionsWrapper'}, [ React.DOM.header({}, [ React.DOM.div({'className':'button', 'onClick':this.toggleOptions}, "options")