From 0581edb572b6c5482fe65261708431e38ae3ccc7 Mon Sep 17 00:00:00 2001 From: unarist Date: Mon, 22 May 2017 21:57:50 +0900 Subject: [PATCH] Fix "Edit profile" on the account action bar (#3222) --- app/javascript/mastodon/components/dropdown_menu.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/dropdown_menu.js b/app/javascript/mastodon/components/dropdown_menu.js index ea86066264..4fe4db313c 100644 --- a/app/javascript/mastodon/components/dropdown_menu.js +++ b/app/javascript/mastodon/components/dropdown_menu.js @@ -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); }