From 424c367ecc7c2b7f607d5d973056365591a7aac6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 6 Feb 2018 18:45:43 +0000 Subject: [PATCH] Fix the reject/accept call buttons in canary (mk2) Fixes https://github.com/vector-im/riot-web/issues/6081 by making the accept/reject buttons AccessibleButtons which they should be anyway (presumably the role=button makes chrome do the right thing with the events). Also swallow the onClick event otherwise that propagates out to the room header and causes it to expand/collapse. --- src/components/views/voip/IncomingCallBox.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index 8d75029baa..c0dff4e8a3 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2018 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -18,6 +19,7 @@ import PropTypes from 'prop-types'; import MatrixClientPeg from '../../../MatrixClientPeg'; import dis from '../../../dispatcher'; import { _t } from '../../../languageHandler'; +import AccessibleButton from '../elements/AccessibleButton'; module.exports = React.createClass({ displayName: 'IncomingCallBox', @@ -26,14 +28,16 @@ module.exports = React.createClass({ incomingCall: PropTypes.object, }, - onAnswerClick: function() { + onAnswerClick: function(e) { + e.stopPropagation(); dis.dispatch({ action: 'answer', room_id: this.props.incomingCall.roomId, }); }, - onRejectClick: function() { + onRejectClick: function(e) { + e.stopPropagation(); dis.dispatch({ action: 'hangup', room_id: this.props.incomingCall.roomId, @@ -67,14 +71,14 @@ module.exports = React.createClass({
-
+ { _t("Decline") } -
+
-
+ { _t("Accept") } -
+