From 6d13ea0043af174c8c64fdbd41077e29eaa6ea0d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 13 Sep 2019 14:33:09 +0200 Subject: [PATCH] stop propagation click handler for doesn't run --- src/components/structures/RoomDirectory.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 7c0b8e00e1..7085461633 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -369,25 +369,27 @@ module.exports = React.createClass({ } }, - onPreviewClick: function(room) { + onPreviewClick: function(ev, room) { this.props.onFinished(); dis.dispatch({ action: 'view_room', room_id: room.room_id, should_peek: true, }); + ev.stopPropagation(); }, - onViewClick: function(room) { + onViewClick: function(ev, room) { this.props.onFinished(); dis.dispatch({ action: 'view_room', room_id: room.room_id, should_peek: false, }); + ev.stopPropagation(); }, - onJoinClick: function(room) { + onJoinClick: function(ev, room) { this.props.onFinished(); MatrixClientPeg.get().joinRoom(room.room_id); dis.dispatch({ @@ -395,6 +397,7 @@ module.exports = React.createClass({ room_id: room.room_id, joining: true, }); + ev.stopPropagation(); }, onCreateRoomClick: function(room) { @@ -458,16 +461,16 @@ module.exports = React.createClass({ if (room.world_readable && !hasJoinedRoom) { previewButton = ( - this.onPreviewClick(room)}>{_t("Preview")} + this.onPreviewClick(ev, room)}>{_t("Preview")} ); } if (hasJoinedRoom) { joinOrViewButton = ( - this.onViewClick(room)}>{_t("View")} + this.onViewClick(ev, room)}>{_t("View")} ); } else if (!isGuest || room.guest_can_join) { joinOrViewButton = ( - this.onJoinClick(room)}>{_t("Join")} + this.onJoinClick(ev, room)}>{_t("Join")} ); }