Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(info): invite url as an anchor for copying from context menu

Leonard Kimc3772190136c
diff --git a/css/modals/invite/_info.scss b/css/modals/invite/_info.scss
index 5ad65d7e09..0bf39d666c 100644
--- a/css/modals/invite/_info.scss
+++ b/css/modals/invite/_info.scss
@@ -81,6 +81,11 @@
font-size: 16px;
}
+ .info-dialog-invite-link {
+ color: inherit;
+ cursor: inherit;
+ }
+
.info-dialog-title {
font-weight: bold;
margin-bottom: 10px;
diff --git a/react/features/invite/components/info-dialog/InfoDialog.web.js b/react/features/invite/components/info-dialog/InfoDialog.web.js
index fd3c72e48f..fa8302d3e2 100644
--- a/react/features/invite/components/info-dialog/InfoDialog.web.js
+++ b/react/features/invite/components/info-dialog/InfoDialog.web.js
@@ -147,6 +147,7 @@ class InfoDialog extends Component {
this._copyElement = null;
// Bind event handlers so they are only bound once for every instance.
+ this._onClickInviteURL = this._onClickInviteURL.bind(this);
this._onCopyInviteURL = this._onCopyInviteURL.bind(this);
this._onPasswordRemove = this._onPasswordRemove.bind(this);
this._onPasswordSubmit = this._onPasswordSubmit.bind(this);
@@ -219,7 +220,12 @@ class InfoDialog extends Component {
</span>
<span className = 'spacer'>&nbsp;</span>
<span className = 'info-value'>
- { this._getURLToDisplay() }
+ <a
+ className = 'info-dialog-invite-link'
+ href = { this.props._inviteURL }
+ onClick = { this._onClickInviteURL } >
+ { this._getURLToDisplay() }
+ </a>
</span>
</div>
<div className = 'info-dialog-dial-in'>
@@ -346,6 +352,20 @@ class InfoDialog extends Component {
return this.props._inviteURL.replace(/^https?:\/\//i, '');
}
+ /**
+ * Callback invoked when the displayed invite URL link is clicked to prevent
+ * actual navigation from happening. The invite URL link has an href to
+ * display "Copy Link Address" in the context menu but otherwise it should
+ * not behave like a link.
+ *
+ * @param {Object} event - The click event from clicking on the link.
+ * @private
+ * @returns {void}
+ */
+ _onClickInviteURL(event) {
+ event.preventDefault();
+ }
+
/**
* Callback invoked to copy the contents of {@code this._copyElement} to the
* clipboard.