From e8702aafa564030699e81a511aaeebcdd2785df4 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 1 Jul 2020 23:09:02 +0100
Subject: [PATCH 3/5] delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/views/rooms/RoomTile2.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/views/rooms/RoomTile2.tsx b/src/components/views/rooms/RoomTile2.tsx
index 47b5b4206b..7a07027913 100644
--- a/src/components/views/rooms/RoomTile2.tsx
+++ b/src/components/views/rooms/RoomTile2.tsx
@@ -73,7 +73,7 @@ interface IState {
const contextMenuBelow = (elementRect: PartialDOMRect) => {
// align the context menu's icons with the icon which opened the context menu
const left = elementRect.left + window.pageXOffset - 9;
- let top = elementRect.bottom + window.pageYOffset + 17;
+ const top = elementRect.bottom + window.pageYOffset + 17;
const chevronFace = "none";
return {left, top, chevronFace};
};
From 6424ffb22a6e99ad61a094c4f8433b42c8d9f93b Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 1 Jul 2020 23:13:54 +0100
Subject: [PATCH 4/5] fix repeated context menu interaction by not erroring
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/UserMenu.tsx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx
index 92a4666a9d..1cfe244845 100644
--- a/src/components/structures/UserMenu.tsx
+++ b/src/components/structures/UserMenu.tsx
@@ -125,9 +125,7 @@ export default class UserMenu extends React.Component
{
});
};
- private onCloseMenu = (ev: InputEvent) => {
- ev.preventDefault();
- ev.stopPropagation();
+ private onCloseMenu = () => {
this.setState({contextMenuPosition: null});
};
From 4b27a67e336854f1f634b582ee3670a16a931623 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 1 Jul 2020 23:16:54 +0100
Subject: [PATCH 5/5] improve default behaviour for consistency
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---
src/components/structures/ContextMenu.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/components/structures/ContextMenu.js b/src/components/structures/ContextMenu.js
index a56a987fcf..5ba2662796 100644
--- a/src/components/structures/ContextMenu.js
+++ b/src/components/structures/ContextMenu.js
@@ -347,10 +347,18 @@ export class ContextMenu extends React.Component {
}
// Semantic component for representing the AccessibleButton which launches a
-export const ContextMenuButton = ({ label, isExpanded, children, ...props }) => {
+export const ContextMenuButton = ({ label, isExpanded, children, onClick, onContextMenu, ...props }) => {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
return (
-
+
{ children }
);