From 3f62f20a8594aa233c9bcda365dbfd19a66f0783 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 3 Jul 2020 16:29:48 +0100 Subject: [PATCH] Fix theme selector bubbling out its click events and causing context menu to float away Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/UserMenu.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index ff828e0da7..b65e9f1cb6 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -130,7 +130,10 @@ export default class UserMenu extends React.Component { this.setState({contextMenuPosition: null}); }; - private onSwitchThemeClick = () => { + private onSwitchThemeClick = (ev: React.MouseEvent) => { + ev.preventDefault(); + ev.stopPropagation(); + // Disable system theme matching if the user hits this button SettingsStore.setValue("use_system_theme", null, SettingLevel.DEVICE, false);