From 2140619c0ba619602b90ef9526b1278335f7f3d8 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 17 Mar 2017 22:14:51 +0100 Subject: [PATCH] Prevent reverting editable user bio on click Turns out the click handler was bound to the surrounding element rather than the one that wraps the rendered bio when it is not being edited. Fixes #1145. --- js/forum/dist/app.js | 5 ++--- js/forum/src/components/UserBio.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/js/forum/dist/app.js b/js/forum/dist/app.js index 8543450b1..dc6935d11 100644 --- a/js/forum/dist/app.js +++ b/js/forum/dist/app.js @@ -28539,7 +28539,7 @@ System.register('flarum/components/UserBio', ['flarum/Component', 'flarum/compon content = m( 'div', - { className: 'UserBio-content' }, + { className: 'UserBio-content', onclick: this.edit.bind(this) }, subContent ); } @@ -28549,8 +28549,7 @@ System.register('flarum/components/UserBio', ['flarum/Component', 'flarum/compon { className: 'UserBio ' + classList({ editable: this.props.editable, editing: this.editing - }), - onclick: this.edit.bind(this) }, + }) }, content ); } diff --git a/js/forum/src/components/UserBio.js b/js/forum/src/components/UserBio.js index 7f1aa2b04..41795a05f 100644 --- a/js/forum/src/components/UserBio.js +++ b/js/forum/src/components/UserBio.js @@ -45,15 +45,14 @@ export default class UserBio extends Component { } } - content =
{subContent}
; + content =
{subContent}
; } return (
+ })}> {content}
);