From c8d9db2656bc263986bddb972bbe74295c778c2e Mon Sep 17 00:00:00 2001 From: Adam Butterworth Date: Mon, 11 Mar 2019 15:36:01 -0400 Subject: [PATCH] fix: use onChange instead of onInput to fix broken upload on mobile (#70) --- src/components/ProfilePage/ProfileAvatar.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ProfilePage/ProfileAvatar.jsx b/src/components/ProfilePage/ProfileAvatar.jsx index b41769c..b35713e 100644 --- a/src/components/ProfilePage/ProfileAvatar.jsx +++ b/src/components/ProfilePage/ProfileAvatar.jsx @@ -17,7 +17,7 @@ class ProfileAvatar extends React.Component { this.onClickUpload = this.onClickUpload.bind(this); this.onClickDelete = this.onClickDelete.bind(this); - this.onInput = this.onInput.bind(this); + this.onChangeInput = this.onChangeInput.bind(this); this.onSubmit = this.onSubmit.bind(this); this.toggleDropdown = this.toggleDropdown.bind(this); } @@ -30,13 +30,14 @@ class ProfileAvatar extends React.Component { this.props.onDelete(); } - onInput() { + onChangeInput() { this.onSubmit(); } onSubmit(e) { if (e) e.preventDefault(); this.props.onSave(new FormData(this.form.current)); + this.form.current.reset(); } toggleDropdown() { @@ -134,7 +135,7 @@ class ProfileAvatar extends React.Component { type="file" name="file" id="photo-file" - onInput={this.onInput} + onChange={this.onChangeInput} accept=".jpg, .jpeg, .png" />