From 07af8c05fd65eb705bfbeadf6727cf0f72c79f20 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 ea8606626..4fe4db313 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); }