From 06abccabb4de53832a12f504e7c1c01b3ef788d3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 7 May 2018 18:26:37 +0200 Subject: [PATCH 1/2] Fix InputField controlled / uncontrolled mode --- .../client/components/ChangePassword.js | 6 +++++- .../client/components/InputField.js | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/talk-plugin-local-auth/client/components/ChangePassword.js b/plugins/talk-plugin-local-auth/client/components/ChangePassword.js index 8f86fff48..a375e90a4 100644 --- a/plugins/talk-plugin-local-auth/client/components/ChangePassword.js +++ b/plugins/talk-plugin-local-auth/client/components/ChangePassword.js @@ -14,7 +14,11 @@ const initialState = { editing: false, showErrors: true, errors: {}, - formData: {}, + formData: { + oldPassword: '', + newPassword: '', + confirmNewPassword: '', + }, }; class ChangePassword extends React.Component { diff --git a/plugins/talk-plugin-local-auth/client/components/InputField.js b/plugins/talk-plugin-local-auth/client/components/InputField.js index 930c15582..7dca22197 100644 --- a/plugins/talk-plugin-local-auth/client/components/InputField.js +++ b/plugins/talk-plugin-local-auth/client/components/InputField.js @@ -19,13 +19,13 @@ const InputField = ({ showSuccess = false, validationType = '', icon = '', - value = '', - defaultValue = '', + value, + defaultValue, disabled = false, }) => { const inputValue = { - ...(value ? { value } : {}), - ...(defaultValue ? { defaultValue } : {}), + ...(value !== undefined ? { value } : {}), + ...(defaultValue !== undefined ? { defaultValue } : {}), }; return ( From 4fb511e48832109e1322b51e1078b15458dc35f2 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 7 May 2018 21:07:46 +0200 Subject: [PATCH 2/2] Fix save icon --- plugins/talk-plugin-local-auth/client/components/Profile.css | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/talk-plugin-local-auth/client/components/Profile.css b/plugins/talk-plugin-local-auth/client/components/Profile.css index 08187e238..920b93260 100644 --- a/plugins/talk-plugin-local-auth/client/components/Profile.css +++ b/plugins/talk-plugin-local-auth/client/components/Profile.css @@ -29,6 +29,7 @@ .actions { flex-grow: 0; + flex-shrink: 0; display: flex; flex-direction: column; align-items: center;