]> cat aescling's git repositories - mastodon.git/commitdiff
Fix "Edit profile" on the account action bar (#3222)
authorunarist <m.unarist@gmail.com>
Mon, 22 May 2017 12:57:50 +0000 (21:57 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 22 May 2017 12:57:50 +0000 (14:57 +0200)
app/javascript/mastodon/components/dropdown_menu.js

index ea86066264362b1a239677bea3dcf4ba60a86e13..4fe4db313cc81a8191c991f3933dac57d7439a6a 100644 (file)
@@ -33,11 +33,14 @@ class DropdownMenu extends React.PureComponent {
     const i = Number(e.currentTarget.getAttribute('data-index'));
     const { action, to } = this.props.items[i];
 
-    e.preventDefault();
+    // Don't call e.preventDefault() when the item uses 'href' property.
+    // ex. "Edit profile" on the account action bar
 
     if (typeof action === 'function') {
+      e.preventDefault();
       action();
     } else if (to) {
+      e.preventDefault();
       this.context.router.push(to);
     }