diff --git a/react/features/base/dialog/components/StatelessDialog.web.js b/react/features/base/dialog/components/StatelessDialog.web.js
index ff39b0845..b74b8df38 100644
--- a/react/features/base/dialog/components/StatelessDialog.web.js
+++ b/react/features/base/dialog/components/StatelessDialog.web.js
@@ -7,6 +7,18 @@ import { translate } from '../../i18n';
import { DIALOG_PROP_TYPES } from '../constants';
+/**
+ * The ID to be used for the cancel button if enabled.
+ * @type {string}
+ */
+const CANCEL_BUTTON_ID = 'modal-dialog-cancel-button';
+
+/**
+ * The ID to be used for the ok button if enabled.
+ * @type {string}
+ */
+const OK_BUTTON_ID = 'modal-dialog-ok-button';
+
/**
* Web dialog that uses atlaskit modal-dialog to display dialogs.
*/
@@ -63,7 +75,34 @@ class StatelessDialog extends Component {
// Bind event handlers so they are only bound once for every instance.
this._onCancel = this._onCancel.bind(this);
this._onDialogDismissed = this._onDialogDismissed.bind(this);
+ this._onKeyDown = this._onKeyDown.bind(this);
this._onSubmit = this._onSubmit.bind(this);
+ this._setDialogElement = this._setDialogElement.bind(this);
+ }
+
+ /**
+ * React Component method that executes once component is mounted.
+ *
+ * @inheritdoc
+ */
+ componentDidMount() {
+ this._updateButtonFocus();
+ }
+
+ /**
+ * React Component method that executes once component is updated.
+ *
+ * @param {Object} prevProps - The previous properties, before the update.
+ * @returns {void}
+ */
+ componentDidUpdate(prevProps) {
+ // if there is an update in any of the buttons enable/disable props
+ // update the focus if needed
+ if (prevProps.okDisabled !== this.props.okDisabled
+ || prevProps.cancelDisabled !== this.props.cancelDisabled
+ || prevProps.submitDisabled !== this.props.submitDisabled) {
+ this._updateButtonFocus();
+ }
}
/**
@@ -74,21 +113,25 @@ class StatelessDialog extends Component {
*/
render() {
return (
-